@Test public void testDictionary() { HeapIntVector col = new HeapIntVector(VECTOR_SIZE); int[] dict = new int[2]; dict[0] = 1998; dict[1] = 9998; col.setDictionary(new TestDictionary(dict)); HeapIntVector heapIntVector = col.reserveDictionaryIds(VECTOR_SIZE); for (int i = 0; i < VECTOR_SIZE; i++) { heapIntVector.vector[i] = i % 2 == 0 ? 0 : 1; } VectorizedColumnBatch batch = new VectorizedColumnBatch(new ColumnVector[]{col}); for (int i = 0; i < VECTOR_SIZE; i++) { ColumnarRow row = new ColumnarRow(batch, i); if (i % 2 == 0) { assertEquals(row.getInt(0), 1998); } else { assertEquals(row.getInt(0), 9998); } } }
public int getInt(int rowId, int colId) { return ((IntColumnVector) columns[colId]).getInt(rowId); }
VectorizedColumnBatch implements Serializable { public int getInt(int rowId, int colId) { return ((IntColumnVector) columns[colId]).getInt(rowId); } }
VectorizedColumnBatch implements Serializable { public int getInt(int rowId, int colId) { return ((IntColumnVector) columns[colId]).getInt(rowId); } VectorizedColumnBatch(ColumnVector[] vectors); }
VectorizedColumnBatch implements Serializable { public int getInt(int rowId, int colId) { return ((IntColumnVector) columns[colId]).getInt(rowId); } VectorizedColumnBatch(ColumnVector[] vectors); void reset(); void setNumRows(int numRows); int getNumRows(); int getArity(); boolean isNullAt(int rowId, int colId); boolean getBoolean(int rowId, int colId); byte getByte(int rowId, int colId); short getShort(int rowId, int colId); int getInt(int rowId, int colId); long getLong(int rowId, int colId); float getFloat(int rowId, int colId); double getDouble(int rowId, int colId); Bytes getByteArray(int rowId, int colId); String getString(int rowId, int colId); Decimal getDecimal(int rowId, int colId, int precision, int scale); }
VectorizedColumnBatch implements Serializable { public int getInt(int rowId, int colId) { return ((IntColumnVector) columns[colId]).getInt(rowId); } VectorizedColumnBatch(ColumnVector[] vectors); void reset(); void setNumRows(int numRows); int getNumRows(); int getArity(); boolean isNullAt(int rowId, int colId); boolean getBoolean(int rowId, int colId); byte getByte(int rowId, int colId); short getShort(int rowId, int colId); int getInt(int rowId, int colId); long getLong(int rowId, int colId); float getFloat(int rowId, int colId); double getDouble(int rowId, int colId); Bytes getByteArray(int rowId, int colId); String getString(int rowId, int colId); Decimal getDecimal(int rowId, int colId, int precision, int scale); static final int DEFAULT_SIZE; final ColumnVector[] columns; }