final ListTypeInfo listTypeInfo = (ListTypeInfo) typeInfo; final TypeInfo elementTypeInfo = listTypeInfo.getListElementTypeInfo(); return new Field(name, FieldType.nullable(MinorType.LIST.getType()), Lists.newArrayList(toField(DEFAULT_ARROW_FIELD_NAME, elementTypeInfo))); case STRUCT: structFields.add(toField(fieldNames.get(i), fieldTypeInfos.get(i))); return new Field(name, FieldType.nullable(MinorType.STRUCT.getType()), structFields); case UNION: final UnionTypeInfo unionTypeInfo = (UnionTypeInfo) typeInfo; unionFields.add(toField(DEFAULT_ARROW_FIELD_NAME, objectTypeInfos.get(i))); return new Field(name, FieldType.nullable(MinorType.UNION.getType()), unionFields); case MAP: final MapTypeInfo mapTypeInfo = (MapTypeInfo) typeInfo;
/** * Instantiate a TimeStampSecVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public TimeStampSecVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.TIMESTAMPSEC.getType()), allocator); }
/** * Instantiate a Float4Vector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public Float4Vector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.FLOAT4.getType()), allocator); }
/** * Instantiate a TimeStampSecTZVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public TimeStampSecTZVector(String name, BufferAllocator allocator, String timeZone) { this(name, FieldType.nullable(new ArrowType.Timestamp(TimeUnit.SECOND, timeZone)), allocator); }
/** * Instantiate a VarCharVector. This doesn't allocate any memory for * the data in vector. * @param name name of the vector * @param allocator allocator for memory management. */ public VarCharVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.VARCHAR.getType()), allocator); }
/** * Instantiate a IntervalYearVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public IntervalYearVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.INTERVALYEAR.getType()), allocator); }
/** * Instantiate a TimeMicroVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public TimeMicroVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.TIMEMICRO.getType()), allocator); }
/** * Instantiate a SmallIntVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public SmallIntVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.SMALLINT.getType()), allocator); }
/** * Instantiate a DateDayVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public DateDayVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.DATEDAY.getType()), allocator); }
/** * Instantiate a TinyIntVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public TinyIntVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.TINYINT.getType()), allocator); }
/** * Instantiate a TimeMilliVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public TimeMilliVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.TIMEMILLI.getType()), allocator); }
/** * Instantiate a TimeSecVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public TimeSecVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.TIMESEC.getType()), allocator); }
/** * Instantiate a TimeNanoVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public TimeNanoVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.TIMENANO.getType()), allocator); }
/** * Instantiate a BitVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public BitVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.BIT.getType()), allocator); }
/** * Instantiate a IntVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public IntVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.INT.getType()), allocator); }
/** * Instantiate a DecimalVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public DecimalVector(String name, BufferAllocator allocator, int precision, int scale) { this(name, FieldType.nullable( new ArrowType.Decimal(precision, scale)), allocator); }
/** * Shortcut method for returning a field * given an arrow type and name * with no sub fields * @param name the name of the field * @param arrowType the arrow type of the field * @return the resulting field */ public static Field field(String name,ArrowType arrowType) { return new Field(name,FieldType.nullable(arrowType), new ArrayList<Field>()); }
/** * Instantiate a TimeStampMicroVector. This doesn't allocate any memory for * the data in vector. * * @param name name of the vector * @param allocator allocator for memory management. */ public TimeStampMicroVector(String name, BufferAllocator allocator) { this(name, FieldType.nullable(MinorType.TIMESTAMPMICRO.getType()), allocator); }
/** Helper method which creates a empty list vector */ private static ListVector testEmptyListVector() { final ListVector vector = new ListVector("emptyListVector", ALLOCATOR, FieldType.nullable(ArrowType.Null.INSTANCE), null); vector.allocateNew(); return vector; }
private VarBinaryVector getOrCreateColumnVector(StructVector sv, String qualifier) { int oldSize = sv.size(); VarBinaryVector v = sv.addOrGet(qualifier, FieldType.nullable(getArrowMinorType(COLUMN_TYPE.getMinorType()).getType()), VarBinaryVector.class); if (oldSize != sv.size()) { v.allocateNew(); } return v; }