Class AvroNullableProducer<T extends FieldVector>
java.lang.Object
org.apache.arrow.adapter.avro.producers.BaseAvroProducer<T>
org.apache.arrow.adapter.avro.producers.AvroNullableProducer<T>
- Type Parameters:
T
- The vector within producer or its delegate, used for partially produce purpose.
- All Implemented Interfaces:
Producer<T>
Producer wrapper which producers nullable types to an avro encoder. Write the data to the
underlying
FieldVector
.-
Field Summary
Fields inherited from class org.apache.arrow.adapter.avro.producers.BaseAvroProducer
currentIndex, vector
-
Constructor Summary
ConstructorsConstructorDescriptionAvroNullableProducer
(Producer<T> delegate) Instantiate a AvroNullableProducer. -
Method Summary
Modifier and TypeMethodDescriptionGet the vector within the producer.void
produce
(org.apache.avro.io.Encoder encoder) Produce a specific type value from the vector and write it to avro encoder.void
resetValueVector
(T vector) Reset the vector within producer.void
setPosition
(int index) Sets the current index for this producer against the underlying vector.void
skipNull()
Skip null value in the vector by setting reader position + 1.
-
Constructor Details
-
AvroNullableProducer
Instantiate a AvroNullableProducer.
-
-
Method Details
-
produce
Description copied from interface:Producer
Produce a specific type value from the vector and write it to avro encoder.- Parameters:
encoder
- avro encoder to write data- Throws:
IOException
- on error
-
skipNull
public void skipNull()Description copied from interface:Producer
Skip null value in the vector by setting reader position + 1.- Specified by:
skipNull
in interfaceProducer<T extends FieldVector>
- Overrides:
skipNull
in classBaseAvroProducer<T extends FieldVector>
-
setPosition
public void setPosition(int index) Description copied from class:BaseAvroProducer
Sets the current index for this producer against the underlying vector.For a vector of length N, the valid range is [0, N] inclusive. Setting index = N signifies that no further data is available for production (this is the state the produce will be in when production for the current vector is complete).
- Specified by:
setPosition
in interfaceProducer<T extends FieldVector>
- Overrides:
setPosition
in classBaseAvroProducer<T extends FieldVector>
- Parameters:
index
- New current index for the producer
-
resetValueVector
Description copied from interface:Producer
Reset the vector within producer.- Specified by:
resetValueVector
in interfaceProducer<T extends FieldVector>
- Overrides:
resetValueVector
in classBaseAvroProducer<T extends FieldVector>
-
getVector
Description copied from interface:Producer
Get the vector within the producer.- Specified by:
getVector
in interfaceProducer<T extends FieldVector>
- Overrides:
getVector
in classBaseAvroProducer<T extends FieldVector>
-