Source:
public int serialize(int index, Tuple tuple, OutputStream out, byte[] nullCharacters) throws IOException { Column col = schema.getColumn(index); TajoDataTypes.Type type = col.getDataType().getType(); if (tuple.isBlankOrNull(index)) { if (type == TajoDataTypes.Type.CHAR || type == TajoDataTypes.Type.TEXT) { out.write(nullCharacters); return nullCharacters.length; } return 0; } byte[] bytes; int length = 0; switch (type) { case BOOLEAN: out.write(tuple.getBool(index) ? trueBytes : falseBytes); length = trueBytes.length; break; case CHAR: int size = col.getDataType().getLength() - tuple.size(index); if (size < 0){ throw new ValueTooLongForTypeCharactersException(col.getDataType().getLength()); } byte[] pad = new byte[size]; bytes = tuple.getTextBytes(index); out.write(bytes); out.write(pad); length = bytes.length + pad.length; break; case TEXT: case BIT: case INT2: case INT4: case INT8: case FLOAT4: case FLOAT8: case INET4: case DATE: case INTERVAL: bytes = tuple.getTextBytes(index); length = bytes.length; out.write(bytes); break; case TIME: bytes = tuple.getTextBytes(index); length = bytes.length; out.write(bytes); break; case TIMESTAMP: bytes = TimestampDatum.asChars(tuple.getTimeDate(index), TAJO_CONF.getSystemTimezone(), true).getBytes(); length = bytes.length; out.write(bytes); break; case INET6: case BLOB: bytes = Base64.encodeBase64(tuple.getBytes(index), false); length = bytes.length; out.write(bytes, 0, length); break; case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) tuple.getProtobufDatum(index); byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length); break; case NULL_TYPE: default: break; } return length; }

Target:
public int serialize(int index, Tuple tuple, OutputStream out, byte[] nullCharacters) throws IOException { Column col = schema.getColumn(index); TajoDataTypes.Type type = col.getDataType().getType(); if (tuple.isBlankOrNull(index)) { if (type == TajoDataTypes.Type.CHAR || type == TajoDataTypes.Type.TEXT) { out.write(nullCharacters); return nullCharacters.length; } return 0; } byte[] bytes; int length = 0; switch (type) { case BOOLEAN: out.write(tuple.getBool(index) ? trueBytes : falseBytes); length = trueBytes.length; break; case CHAR: int size = col.getDataType().getLength() - tuple.size(index); if (size < 0){ throw new ValueTooLongForTypeCharactersException(col.getDataType().getLength()); } byte[] pad = new byte[size]; bytes = tuple.getTextBytes(index); out.write(bytes); out.write(pad); length = bytes.length + pad.length; break; case TEXT: case BIT: case INT2: case INT4: case INT8: case FLOAT4: case FLOAT8: case INET4: case DATE: case INTERVAL: bytes = tuple.getTextBytes(index); length = bytes.length; out.write(bytes); break; case TIME: bytes = tuple.getTextBytes(index); length = bytes.length; out.write(bytes); break; case INET6: case BLOB: bytes = Base64.encodeBase64(tuple.getBytes(index), false); length = bytes.length; out.write(bytes, 0, length); break; case PROTOBUF: ProtobufDatum protobuf = (ProtobufDatum) tuple.getProtobufDatum(index); byte[] protoBytes = protobufJsonFormat.printToString(protobuf.get()).getBytes(); length = protoBytes.length; out.write(protoBytes, 0, protoBytes.length); break; case NULL_TYPE: default: break; } return length; }