@Override public void fillVector(byte[] data, CarbonColumnVector vector) { // start position will be used to store the current data position int localOffset = 0; for (int i = 0; i < numberOfRows; i++) { int length = (((data[localOffset] & 0xFF) << 8) | (data[localOffset + 1] & 0xFF)); localOffset += 2; if (length == 0) { vector.putNull(i); } else { vector.putBoolean(i, ByteUtil.toBoolean(data[localOffset])); } localOffset += length; } } }
return ByteUtil.toBytes(Boolean.valueOf(ByteUtil.toBoolean((byte) dimensionValue))); } else if (actualDataType == DataTypes.SHORT) { return ByteUtil.toXorBytes((Short) dimensionValue);
@Override public Object getCurrentValue() throws IOException, InterruptedException { rowCount += 1; Object[] row = new Object[carbonColumnarBatch.columnVectors.length]; for (int i = 0; i < carbonColumnarBatch.columnVectors.length; i ++) { Object data = carbonColumnarBatch.columnVectors[i].getData(batchIdx - 1); if (carbonColumnarBatch.columnVectors[i].getType() == DataTypes.STRING || carbonColumnarBatch.columnVectors[i].getType() == DataTypes.VARCHAR) { if (data == null) { row[i] = null; } else { row[i] = ByteUtil.toString((byte[]) data, 0, (((byte[]) data).length)); } } else if (carbonColumnarBatch.columnVectors[i].getType() == DataTypes.BOOLEAN) { if (data == null) { row[i] = null; } else { row[i] = ByteUtil.toBoolean((byte) data); } } else { row[i] = carbonColumnarBatch.columnVectors[i].getData(batchIdx - 1); } } return row; }
long longData = columnPage.getLong(rowId); if (dt == DataTypes.BOOLEAN) { vector.putBoolean(vectorRow, ByteUtil.toBoolean((byte) longData)); } else if (dt == DataTypes.BYTE) { vector.putByte(vectorRow, (byte) longData);
return ByteUtil.toBoolean(dataInBytes); } else if (actualDataType == DataTypes.BYTE) { return dataInBytes[0];
} else if (srcDataType == DataTypes.BOOLEAN) { byte out = (byte) longData; return ByteUtil.toBytes(ByteUtil.toBoolean(out)); } else if (srcDataType == DataTypes.SHORT) { short out = (short) longData; byte[] out = new byte[1]; out[0] = (columnPage.getByte(rowId)); return ByteUtil.toBytes(ByteUtil.toBoolean(out)); } else if (srcDataType == DataTypes.BYTE_ARRAY) { return columnPage.getBytes(rowId);
vector.putByteArray(vectorRow, 0, length, value); } else if (dt == DataTypes.BOOLEAN) { vector.putBoolean(vectorRow, ByteUtil.toBoolean(value[0])); } else if (dt == DataTypes.BYTE) { vector.putByte(vectorRow,value[0]);
vector.putByteArray(vectorRow, currentDataOffset, length, data); } else if (dt == DataTypes.BOOLEAN) { vector.putBoolean(vectorRow, ByteUtil.toBoolean(data[currentDataOffset])); } else if (dt == DataTypes.SHORT) { vector.putShort(vectorRow, ByteUtil.toXorShort(data, currentDataOffset, length));