// All ValueVector types have been handled.
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported. Mode: " + type.getMode());
}
public static ValueHolder getValue(ValueVector vector, int index) {
MajorType type = vector.getField().getType();
ValueHolder holder;
switch(type.getMinorType()) {
case TINYINT :
holder = new TinyIntHolder();
((TinyIntHolder)holder).value = ((TinyIntVector) vector).getAccessor().get(index);
break;
case UINT1 :
holder = new UInt1Holder();
((UInt1Holder)holder).value = ((UInt1Vector) vector).getAccessor().get(index);
break;
case UINT2 :
holder = new UInt2Holder();
((UInt2Holder)holder).value = ((UInt2Vector) vector).getAccessor().get(index);
break;
case SMALLINT :
holder = new SmallIntHolder();
((SmallIntHolder)holder).value = ((SmallIntVector) vector).getAccessor().get(index);
break;
case INT :
holder = new IntHolder();
((IntHolder)holder).value = ((IntVector) vector).getAccessor().get(index);
break;
case UINT4 :
holder = new UInt4Holder();
((UInt4Holder)holder).value = ((UInt4Vector) vector).getAccessor().get(index);
break;
case FLOAT4 :
holder = new Float4Holder();
((Float4Holder)holder).value = ((Float4Vector) vector).getAccessor().get(index);
break;
case TIME :
holder = new TimeHolder();
((TimeHolder)holder).value = ((TimeVector) vector).getAccessor().get(index);
break;
case INTERVALYEAR :
holder = new IntervalYearHolder();
((IntervalYearHolder)holder).value = ((IntervalYearVector) vector).getAccessor().get(index);
break;
case DECIMAL9 :
holder = new Decimal9Holder();
((Decimal9Holder)holder).value = ((Decimal9Vector) vector).getAccessor().get(index);
break;
case BIGINT :
holder = new BigIntHolder();
((BigIntHolder)holder).value = ((BigIntVector) vector).getAccessor().get(index);
break;
case UINT8 :
holder = new UInt8Holder();
((UInt8Holder)holder).value = ((UInt8Vector) vector).getAccessor().get(index);
break;
case FLOAT8 :
holder = new Float8Holder();
((Float8Holder)holder).value = ((Float8Vector) vector).getAccessor().get(index);
break;
case DATE :
holder = new DateHolder();
((DateHolder)holder).value = ((DateVector) vector).getAccessor().get(index);
break;
case TIMESTAMP :
holder = new TimeStampHolder();
((TimeStampHolder)holder).value = ((TimeStampVector) vector).getAccessor().get(index);
break;
case DECIMAL18 :
holder = new Decimal18Holder();
((Decimal18Holder)holder).value = ((Decimal18Vector) vector).getAccessor().get(index);
break;
case TIMESTAMPTZ :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case INTERVALDAY :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case INTERVAL :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case DECIMAL28DENSE :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case DECIMAL38DENSE :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case DECIMAL38SPARSE :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case DECIMAL28SPARSE :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case VARBINARY :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case VARCHAR :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case VAR16CHAR :
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
case BIT :
holder = new BitHolder();
((BitHolder)holder).value = ((BitVector) vector).getAccessor().get(index);
break;
case GENERIC_OBJECT:
holder = new ObjectHolder();
((ObjectHolder)holder).obj = ((ObjectVector) vector).getAccessor().getObject(index) ;
break;
default:
throw new UnsupportedOperationException(type.getMinorType() + " type is not supported.");
}
return holder;
}