protected static void write(DataOutput out, DataBag v) throws IOException { bis.writeDatum(out, v, DataType.BAG); }
@Override public void write(DataOutput out) throws IOException { bis.writeDatum(out, value, DataType.BIGINTEGER); }
@Override public void write(DataOutput out) throws IOException { bis.writeDatum(out, value, DataType.BIGDECIMAL); }
protected static void write(DataOutput out, Map<String, Object> v) throws IOException { bis.writeDatum(out, v, DataType.MAP); }
protected static void write(DataOutput out, BigDecimal v) throws IOException { bis.writeDatum(out, v, DataType.BIGDECIMAL); }
protected static void write(DataOutput out, BigInteger v) throws IOException { bis.writeDatum(out, v, DataType.BIGINTEGER); }
private void writeBigInteger(DataOutput out, BigInteger bi) throws IOException { writeDatum(out, bi.toString()); }
private void writeBigDecimal(DataOutput out, BigDecimal bd) throws IOException { writeDatum(out, bd.toString()); }
@Override public void writeDatum(DataOutput out, Object val) throws IOException { // Read the data type byte type = DataType.findType(val); writeDatum(out, val, type); }
private void writeMap(DataOutput out, Map<String, Object> m) throws IOException { final int sz = m.size(); if (sz < UNSIGNED_BYTE_MAX) { out.writeByte(TINYMAP); out.writeByte(sz); } else if (sz < UNSIGNED_SHORT_MAX) { out.writeByte(SMALLMAP); out.writeShort(sz); } else { out.writeByte(MAP); out.writeInt(sz); } Iterator<Map.Entry<String, Object>> i = m.entrySet().iterator(); while (i.hasNext()) { Map.Entry<String, Object> entry = i.next(); writeDatum(out, entry.getKey()); writeDatum(out, entry.getValue()); } }
pigSerializer.writeDatum(out, t.get(i));
while (i.hasNext()) { Map.Entry<Object, Object> entry = i.next(); writeDatum(out, entry.getKey()); writeDatum(out, entry.getValue()); out.writeByte(GENERIC_WRITABLECOMPARABLE); writeDatum(out, val.getClass().getName()); Writable writable = (Writable) val; writable.write(out);