@Override public void write(Writable writable) throws IOException { if(!(writable instanceof AvroGenericRecordWritable)) { throw new IOException("Expecting instance of AvroGenericRecordWritable, " + "but received" + writable.getClass().getCanonicalName()); } AvroGenericRecordWritable r = (AvroGenericRecordWritable)writable; dfw.append(r.getRecord()); }
GenericRecord r = recordWritable.getRecord(); Schema fileSchema = recordWritable.getFileSchema();
GenericRecord r = recordWritable.getRecord(); Schema fileSchema = recordWritable.getFileSchema();
@Override public void write(Writable writable) throws IOException { if(!(writable instanceof AvroGenericRecordWritable)) { throw new IOException("Expecting instance of AvroGenericRecordWritable, " + "but received" + writable.getClass().getCanonicalName()); } AvroGenericRecordWritable r = (AvroGenericRecordWritable)writable; dfw.append(r.getRecord()); }
GenericRecord r = recordWritable.getRecord(); Schema fileSchema = recordWritable.getFileSchema();
@Override public byte[] getBytes(AvroGenericRecordWritable writable) { GenericRecord record = writable.getRecord(); byte[] valueBytes = null; try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { BinaryEncoder be = EncoderFactory.get().directBinaryEncoder(out, null); gdw.setSchema(record.getSchema()); gdw.write(record, be); out.flush(); valueBytes = out.toByteArray(); } catch (IOException e) { Throwables.propagate(new SerDeException(e)); } return valueBytes; }
GenericRecord r = recordWritable.getRecord(); Schema fileSchema = recordWritable.getFileSchema();
@Override public Object deserialize(Writable blob) throws SerDeException { row.set(0, ((AvroGenericRecordWritable) blob).getRecord().toString()); return row; }
GenericRecord r = recordWritable.getRecord(); Schema fileSchema = recordWritable.getFileSchema();
@Override public void write(Writable writable) throws IOException { if(!(writable instanceof AvroGenericRecordWritable)) { throw new IOException("Expecting instance of AvroGenericRecordWritable, " + "but received" + writable.getClass().getCanonicalName()); } AvroGenericRecordWritable r = (AvroGenericRecordWritable)writable; dfw.append(r.getRecord()); }
@Override public void write(Writable writable) throws IOException { if(!(writable instanceof AvroGenericRecordWritable)) { throw new IOException("Expecting instance of AvroGenericRecordWritable, " + "but received" + writable.getClass().getCanonicalName()); } AvroGenericRecordWritable r = (AvroGenericRecordWritable)writable; dfw.append(r.getRecord()); }
@Override public byte[] getBytes(AvroGenericRecordWritable writable) { GenericRecord record = writable.getRecord(); byte[] valueBytes = null; try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { BinaryEncoder be = EncoderFactory.get().directBinaryEncoder(out, null); gdw.setSchema(record.getSchema()); gdw.write(record, be); out.flush(); valueBytes = out.toByteArray(); } catch (IOException e) { Throwables.propagate(new SerDeException(e)); } return valueBytes; }
GenericRecord r = recordWritable.getRecord();
value.setRecord(wrapper.getRecord()); long decodeTime = ((secondTime - tempTime));