Package org.apache.avro.generic
Class PrimitivesArrays
java.lang.Object
org.apache.avro.generic.PrimitivesArrays
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GenericData.AbstractArray
<?> createOptimizedArray
(int size, Schema schema, Schema.Type valueType) Create a primitive array if the value type is has an associated optimised implementation, otherwise a generic array is returned.
-
Constructor Details
-
PrimitivesArrays
public PrimitivesArrays()
-
-
Method Details
-
createOptimizedArray
public static GenericData.AbstractArray<?> createOptimizedArray(int size, Schema schema, Schema.Type valueType) Create a primitive array if the value type is has an associated optimised implementation, otherwise a generic array is returned. The value type is determined form the convertedElementType if supplied, otherwise the underlying type from the schema- Parameters:
size
- the size of the array to createschema
- the schema of the arrayvalueType
- the converted elements value type. This may not be the same and the schema if for instance there is a logical type, and a convertor is use- Returns:
- an instance of a primitive array or a Generic array if the value type is does not have an associated optimised implementation.
-