@Override public FieldVector getNewVector( String name, FieldType fieldType, BufferAllocator allocator, CallBack schemaChangeCallback) { return new SmallIntVector(name, fieldType, allocator); }
public TransferImpl(String ref, BufferAllocator allocator) { to = new SmallIntVector(ref, field.getFieldType(), allocator); }
private static Pair<SmallIntVector, ResultVerifier> testSmallIntVector(final int startIndexInCurrentOutput, final int startIndexInJob) { SmallIntVector colSmallIntV = new SmallIntVector("colSmallInt", allocator); colSmallIntV.allocateNew(5); colSmallIntV.set(0, 20); colSmallIntV.setNull(1); colSmallIntV.set(2, -2000); colSmallIntV.set(3, 32700); colSmallIntV.set(4, 0); ResultVerifier verifier = new ResultVerifier() { @Override public void verify(DataPOJO output) { int index = startIndexInCurrentOutput; assertEquals(20, ((Integer)output.extractValue("colSmallInt", 0)).intValue()); assertNull(output.extractValue("colSmallInt", 1)); assertEquals(-2000, ((Integer)output.extractValue("colSmallInt", 2)).intValue()); assertEquals(32700, ((Integer)output.extractValue("colSmallInt", 3)).intValue()); assertEquals(0, ((Integer)output.extractValue("colSmallInt", 4)).intValue()); } }; return Pair.of(colSmallIntV, verifier); }
return new UInt2Vector(field.getName(), allocator); case SMALLINT: return new SmallIntVector(field.getName(), allocator); case INT: return new IntVector(field.getName(), allocator);