Class PrimitivesArrays

java.lang.Object
org.apache.avro.generic.PrimitivesArrays

public class PrimitivesArrays extends Object
  • 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 create
      schema - the schema of the array
      valueType - 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.