}
throw new UnsupportedOperationException();
}
public static ValueVector getNewVector(MaterializedField field, BufferAllocator allocator){
MajorType type = field.getType();
switch (type.getMinorType()) {
case MAP:
switch (type.getMode()) {
case REQUIRED:
return new MapVector(field, allocator);
case REPEATED:
return new RepeatedMapVector(field, allocator);
}
case LIST:
switch (type.getMode()) {
case REPEATED:
return new RepeatedListVector(field, allocator);
}
case TINYINT:
switch (type.getMode()) {
case REQUIRED:
return new TinyIntVector(field, allocator);
case OPTIONAL:
return new NullableTinyIntVector(field, allocator);
case REPEATED:
return new RepeatedTinyIntVector(field, allocator);
}
case UINT1:
switch (type.getMode()) {
case REQUIRED:
return new UInt1Vector(field, allocator);
case OPTIONAL:
return new NullableUInt1Vector(field, allocator);
case REPEATED:
return new RepeatedUInt1Vector(field, allocator);
}
case UINT2:
switch (type.getMode()) {
case REQUIRED:
return new UInt2Vector(field, allocator);
case OPTIONAL:
return new NullableUInt2Vector(field, allocator);
case REPEATED:
return new RepeatedUInt2Vector(field, allocator);
}
case SMALLINT:
switch (type.getMode()) {
case REQUIRED:
return new SmallIntVector(field, allocator);
case OPTIONAL:
return new NullableSmallIntVector(field, allocator);
case REPEATED:
return new RepeatedSmallIntVector(field, allocator);
}
case INT:
switch (type.getMode()) {
case REQUIRED:
return new IntVector(field, allocator);
case OPTIONAL:
return new NullableIntVector(field, allocator);
case REPEATED:
return new RepeatedIntVector(field, allocator);
}
case UINT4:
switch (type.getMode()) {
case REQUIRED:
return new UInt4Vector(field, allocator);
case OPTIONAL:
return new NullableUInt4Vector(field, allocator);
case REPEATED:
return new RepeatedUInt4Vector(field, allocator);
}
case FLOAT4:
switch (type.getMode()) {
case REQUIRED:
return new Float4Vector(field, allocator);
case OPTIONAL:
return new NullableFloat4Vector(field, allocator);
case REPEATED:
return new RepeatedFloat4Vector(field, allocator);
}
case TIME:
switch (type.getMode()) {
case REQUIRED:
return new TimeVector(field, allocator);
case OPTIONAL:
return new NullableTimeVector(field, allocator);
case REPEATED:
return new RepeatedTimeVector(field, allocator);
}
case INTERVALYEAR:
switch (type.getMode()) {
case REQUIRED:
return new IntervalYearVector(field, allocator);
case OPTIONAL:
return new NullableIntervalYearVector(field, allocator);
case REPEATED:
return new RepeatedIntervalYearVector(field, allocator);
}
case DECIMAL9:
switch (type.getMode()) {
case REQUIRED:
return new Decimal9Vector(field, allocator);
case OPTIONAL:
return new NullableDecimal9Vector(field, allocator);
case REPEATED:
return new RepeatedDecimal9Vector(field, allocator);
}
case BIGINT:
switch (type.getMode()) {
case REQUIRED:
return new BigIntVector(field, allocator);
case OPTIONAL:
return new NullableBigIntVector(field, allocator);
case REPEATED:
return new RepeatedBigIntVector(field, allocator);
}
case UINT8:
switch (type.getMode()) {
case REQUIRED:
return new UInt8Vector(field, allocator);
case OPTIONAL:
return new NullableUInt8Vector(field, allocator);
case REPEATED:
return new RepeatedUInt8Vector(field, allocator);
}
case FLOAT8:
switch (type.getMode()) {
case REQUIRED:
return new Float8Vector(field, allocator);
case OPTIONAL:
return new NullableFloat8Vector(field, allocator);
case REPEATED:
return new RepeatedFloat8Vector(field, allocator);
}
case DATE:
switch (type.getMode()) {
case REQUIRED:
return new DateVector(field, allocator);
case OPTIONAL:
return new NullableDateVector(field, allocator);
case REPEATED:
return new RepeatedDateVector(field, allocator);
}
case TIMESTAMP:
switch (type.getMode()) {
case REQUIRED:
return new TimeStampVector(field, allocator);
case OPTIONAL:
return new NullableTimeStampVector(field, allocator);
case REPEATED:
return new RepeatedTimeStampVector(field, allocator);
}
case DECIMAL18:
switch (type.getMode()) {
case REQUIRED:
return new Decimal18Vector(field, allocator);
case OPTIONAL:
return new NullableDecimal18Vector(field, allocator);
case REPEATED:
return new RepeatedDecimal18Vector(field, allocator);
}
case TIMESTAMPTZ:
switch (type.getMode()) {
case REQUIRED:
return new TimeStampTZVector(field, allocator);
case OPTIONAL:
return new NullableTimeStampTZVector(field, allocator);
case REPEATED:
return new RepeatedTimeStampTZVector(field, allocator);
}
case INTERVALDAY:
switch (type.getMode()) {
case REQUIRED:
return new IntervalDayVector(field, allocator);
case OPTIONAL:
return new NullableIntervalDayVector(field, allocator);
case REPEATED:
return new RepeatedIntervalDayVector(field, allocator);
}
case INTERVAL:
switch (type.getMode()) {
case REQUIRED:
return new IntervalVector(field, allocator);
case OPTIONAL:
return new NullableIntervalVector(field, allocator);
case REPEATED:
return new RepeatedIntervalVector(field, allocator);
}
case DECIMAL28DENSE:
switch (type.getMode()) {
case REQUIRED:
return new Decimal28DenseVector(field, allocator);
case OPTIONAL:
return new NullableDecimal28DenseVector(field, allocator);
case REPEATED:
return new RepeatedDecimal28DenseVector(field, allocator);
}
case DECIMAL38DENSE:
switch (type.getMode()) {
case REQUIRED:
return new Decimal38DenseVector(field, allocator);
case OPTIONAL:
return new NullableDecimal38DenseVector(field, allocator);
case REPEATED:
return new RepeatedDecimal38DenseVector(field, allocator);
}
case DECIMAL38SPARSE:
switch (type.getMode()) {
case REQUIRED:
return new Decimal38SparseVector(field, allocator);
case OPTIONAL:
return new NullableDecimal38SparseVector(field, allocator);
case REPEATED:
return new RepeatedDecimal38SparseVector(field, allocator);
}
case DECIMAL28SPARSE:
switch (type.getMode()) {
case REQUIRED:
return new Decimal28SparseVector(field, allocator);
case OPTIONAL:
return new NullableDecimal28SparseVector(field, allocator);
case REPEATED:
return new RepeatedDecimal28SparseVector(field, allocator);
}
case VARBINARY:
switch (type.getMode()) {
case REQUIRED:
return new VarBinaryVector(field, allocator);
case OPTIONAL:
return new NullableVarBinaryVector(field, allocator);
case REPEATED:
return new RepeatedVarBinaryVector(field, allocator);
}
case VARCHAR:
switch (type.getMode()) {
case REQUIRED:
return new VarCharVector(field, allocator);
case OPTIONAL:
return new NullableVarCharVector(field, allocator);
case REPEATED:
return new RepeatedVarCharVector(field, allocator);
}
case VAR16CHAR:
switch (type.getMode()) {
case REQUIRED:
return new Var16CharVector(field, allocator);
case OPTIONAL:
return new NullableVar16CharVector(field, allocator);
case REPEATED:
return new RepeatedVar16CharVector(field, allocator);
}
case BIT:
switch (type.getMode()) {
case REQUIRED:
return new BitVector(field, allocator);
case OPTIONAL:
return new NullableBitVector(field, allocator);
case REPEATED:
return new RepeatedBitVector(field, allocator);
}
case GENERIC_OBJECT:
return new ObjectVector(field, allocator) ;
default:
break;
}
// All ValueVector types have been handled.
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported. Mode: " + type.getMode());
}