/** * Returns a reader specification for a column encoded using Avro, * and decoded with the generic API using a given Avro schema. * * @param readerSchema Avro reader schema used to decode cells. * @return a reader specification for a column encoded using Avro, * and decoded with the generic API using the specified Avro schema. */ public static ColumnReaderSpec avroReaderSchemaGeneric( final Schema readerSchema ) { return new ColumnReaderSpec( Encoding.AVRO, AvroReaderSchemaType.EXPLICIT, AvroDecoderType.GENERIC, /* avroReaderSchema = */ readerSchema, /* avroReaderSchemaClass = */ null ); }
/** * Returns a reader specification for a column encoded using Avro, * and decoded with the generic API using the writer schema. * * @return a reader specification for a column encoded using Avro, * and decoded with the generic API using the writer schema. */ public static ColumnReaderSpec avroWriterSchemaGeneric() { return new ColumnReaderSpec( Encoding.AVRO, AvroReaderSchemaType.WRITER, AvroDecoderType.GENERIC, /* avroReaderSchema = */ null, /* avroReaderSchemaClass = */ null ); }
/** * Returns a reader specification for a column encoded using Avro, and decoded with the generic * API using the default Avro reader schema specified in the table layout. * * @return a reader specification for a column encoded using Avro, and decoded with the generic * API using the default Avro reader schema specified in the table layout. */ public static ColumnReaderSpec avroDefaultReaderSchemaGeneric() { return new ColumnReaderSpec( Encoding.AVRO, AvroReaderSchemaType.DEFAULT, AvroDecoderType.GENERIC, /* avroReaderSchema = */ null, /* avroReaderSchemaClass = */ null ); }
/** * Returns a reader specification for a column encoded using Avro, * and decoded with the specific API using a given SpecificRecord generated class. * * @param readerSchemaClass Class of the specific record to decode. * @return a reader specification for a column encoded using Avro, * and decoded with the specific API using the given SpecificRecord generated class. * @throws InvalidLayoutException if the specified class is not a valid Avro container class. */ public static ColumnReaderSpec avroReaderSchemaSpecific( final Class<? extends SpecificRecord> readerSchemaClass ) throws InvalidLayoutException { final Schema readerSchema = CellSpec.getSchemaFromClass(readerSchemaClass); return new ColumnReaderSpec( Encoding.AVRO, AvroReaderSchemaType.EXPLICIT, AvroDecoderType.SPECIFIC, /* avroReaderSchema = */ readerSchema, /* avroReaderSchemaClass = */ readerSchemaClass ); }