@Override public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException { ATypeTag tag = unionList.get(b[s + 1]).getTypeTag(); if (tag == ATypeTag.UNION) { printers[b[s + 1]].print(b, s + 1, l, ps); } else { if (tag == ATypeTag.ANY) { printers[b[s + 1]].print(b, s + 2, l, ps); } else { printers[b[s + 1]].print(b, s + 1, l, ps); } } } };
@Override public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException { ATypeTag tag = unionList.get(b[s + 1]).getTypeTag(); if (tag == ATypeTag.UNION) { printers[b[s + 1]].print(b, s + 1, l, ps); } else { if (tag == ATypeTag.ANY) { printers[b[s + 1]].print(b, s + 2, l, ps); } else { printers[b[s + 1]].print(b, s + 1, l, ps); } } } };
@Override public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException { ATypeTag tag = unionList.get(b[s + 1]).getTypeTag(); if (tag == ATypeTag.UNION) { printers[b[s + 1]].print(b, s + 1, l, ps); } else { if (tag == ATypeTag.ANY) { printers[b[s + 1]].print(b, s + 2, l, ps); } else { printers[b[s + 1]].print(b, s + 1, l, ps); } } } };
@Override public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException { ATypeTag tag = unionList.get(b[s + 1]).getTypeTag(); if (tag == ATypeTag.UNION) { printers[b[s + 1]].print(b, s + 1, l, ps); } else { if (tag == ATypeTag.ANY) { printers[b[s + 1]].print(b, s + 2, l, ps); } else { printers[b[s + 1]].print(b, s + 1, l, ps); } } } };
switch (typeTag) { case TINYINT: AInt8PrinterFactory.PRINTER.print(b, s, l, ps); return true; case SMALLINT: AInt16PrinterFactory.PRINTER.print(b, s, l, ps); return true; case INTEGER: AInt32PrinterFactory.PRINTER.print(b, s, l, ps); return true; case BIGINT: AInt64PrinterFactory.PRINTER.print(b, s, l, ps); return true; case MISSING: case NULL: ANullPrinterFactory.PRINTER.print(b, s, l, ps); return true; case BOOLEAN: ABooleanPrinterFactory.PRINTER.print(b, s, l, ps); return true; case FLOAT: AFloatPrinterFactory.PRINTER.print(b, s, l, ps); return true; case DOUBLE: ADoublePrinterFactory.PRINTER.print(b, s, l, ps); return true; case DATE: ADatePrinterFactory.PRINTER.print(b, s, l, ps); return true;
switch (typeTag) { case TINYINT: AInt8PrinterFactory.PRINTER.print(b, s, l, ps); return true; case SMALLINT: AInt16PrinterFactory.PRINTER.print(b, s, l, ps); return true; case INTEGER: AInt32PrinterFactory.PRINTER.print(b, s, l, ps); return true; case BIGINT: AInt64PrinterFactory.PRINTER.print(b, s, l, ps); return true; case MISSING: case NULL: ANullPrinterFactory.PRINTER.print(b, s, l, ps); return true; case BOOLEAN: ABooleanPrinterFactory.PRINTER.print(b, s, l, ps); return true; case FLOAT: AFloatPrinterFactory.PRINTER.print(b, s, l, ps); return true; case DOUBLE: ADoublePrinterFactory.PRINTER.print(b, s, l, ps); return true; case DATE: ADatePrinterFactory.PRINTER.print(b, s, l, ps); return true;
switch (typeTag) { case TINYINT: AInt8PrinterFactory.PRINTER.print(b, s, l, ps); return true; case SMALLINT: AInt16PrinterFactory.PRINTER.print(b, s, l, ps); return true; case INTEGER: AInt32PrinterFactory.PRINTER.print(b, s, l, ps); return true; case BIGINT: AInt64PrinterFactory.PRINTER.print(b, s, l, ps); return true; case MISSING: case NULL: ANullPrinterFactory.PRINTER.print(b, s, l, ps); return true; case BOOLEAN: ABooleanPrinterFactory.PRINTER.print(b, s, l, ps); return true; case FLOAT: AFloatPrinterFactory.PRINTER.print(b, s, l, ps); return true; case DOUBLE: ADoublePrinterFactory.PRINTER.print(b, s, l, ps); return true; case DATE: ADatePrinterFactory.PRINTER.print(b, s, l, ps); return true;
switch (typeTag) { case TINYINT: AInt8PrinterFactory.PRINTER.print(b, s, l, ps); return true; case SMALLINT: AInt16PrinterFactory.PRINTER.print(b, s, l, ps); return true; case INTEGER: AInt32PrinterFactory.PRINTER.print(b, s, l, ps); return true; case BIGINT: AInt64PrinterFactory.PRINTER.print(b, s, l, ps); return true; case MISSING: case NULL: ANullPrinterFactory.PRINTER.print(b, s, l, ps); return true; case BOOLEAN: ABooleanPrinterFactory.PRINTER.print(b, s, l, ps); return true; case FLOAT: AFloatPrinterFactory.PRINTER.print(b, s, l, ps); return true; case DOUBLE: ADoublePrinterFactory.PRINTER.print(b, s, l, ps); return true; case DATE: ADatePrinterFactory.PRINTER.print(b, s, l, ps); return true;
@Override public void nextFrame(ByteBuffer buffer) throws HyracksDataException { tAccess.reset(buffer); int nTuple = tAccess.getTupleCount(); for (int t = 0; t < nTuple; t++) { tRef.reset(tAccess, t); for (int i = 0; i < printers.length; i++) { printers[i].print(buffer.array(), tRef.getFieldStart(i), tRef.getFieldLength(i), ps); ps.print(fieldDelimiter); if (i == printers.length - 1) { ps.print('\n'); } } } }
@Override public void printTuple(IFrameTupleAccessor tAccess, int tIdx) throws HyracksDataException { for (int i = 0; i < fields.length; i++) { int fldStart = tAccess.getTupleStartOffset(tIdx) + tAccess.getFieldSlotsLength() + tAccess.getFieldStartOffset(tIdx, fields[i]); int fldLen = tAccess.getFieldLength(tIdx, fields[i]); if (i > 0) { printStream.print("; "); } printers[i].print(tAccess.getBuffer().array(), fldStart, fldLen, printStream); } printStream.println(); } };
private void printTuple(ArrayTupleBuilder tb, IPrinter[] printers, PrintStream printStream) throws HyracksDataException { int[] offsets = tb.getFieldEndOffsets(); for (int i = 0; i < printers.length; i++) { int offset = i == 0 ? 0 : offsets[i - 1]; int length = i == 0 ? offsets[0] : offsets[i] - offsets[i - 1]; printers[i].print(tb.getByteArray(), offset, length, printStream); printStream.println(); } } }
private void printTuple(ArrayTupleBuilder tb, IPrinter[] printers, PrintStream printStream) throws HyracksDataException { int[] offsets = tb.getFieldEndOffsets(); for (int i = 0; i < printers.length; i++) { int offset = i == 0 ? 0 : offsets[i - 1]; int length = i == 0 ? offsets[0] : offsets[i] - offsets[i - 1]; printers[i].print(tb.getByteArray(), offset, length, printStream); printStream.println(); } }