public Tuple toTuple(byte [] bytes) {
nullFlags.clear();
ByteBuffer bb = ByteBuffer.wrap(bytes);
Tuple tuple = new VTuple(schema.size());
Column col;
TajoDataTypes.DataType type;
bb.limit(headerSize);
nullFlags.fromByteBuffer(bb);
bb.limit(bytes.length);
for (int i =0; i < schema.size(); i++) {
if (nullFlags.get(i)) {
tuple.put(i, DatumFactory.createNullDatum());
continue;
}
col = schema.getColumn(i);
type = col.getDataType();
switch (type.getType()) {
case BOOLEAN: tuple.put(i, DatumFactory.createBool(bb.get())); break;
case BIT:
byte b = bb.get();
tuple.put(i, DatumFactory.createBit(b));