public class StructuredRecordDatumReader extends Object implements DatumReader<co.cask.cdap.api.data.format.StructuredRecord>
DatumReader for reading StructuredRecord.| Constructor and Description |
|---|
StructuredRecordDatumReader() |
public co.cask.cdap.api.data.format.StructuredRecord read(Decoder decoder, co.cask.cdap.api.data.schema.Schema sourceSchema) throws IOException
read in interface DatumReader<co.cask.cdap.api.data.format.StructuredRecord>IOExceptionprotected final Object decode(Decoder decoder, co.cask.cdap.api.data.schema.Schema schema) throws IOException
Schema.decoder - The decoder to decode value fromschema - The schema of the valueIOException - If failed to decodeprotected String decodeEnum(Decoder decoder, co.cask.cdap.api.data.schema.Schema schema) throws IOException
Schema. This method reads an integer as the index in the
enum schema.
Sub-class can override this to have different behavior.decoder - The decode to decode value fromschema - The Schema of the enumString representation of the enum valueIOException - If failed to decodeprotected Collection<?> decodeArray(Decoder decoder, co.cask.cdap.api.data.schema.Schema elementSchema) throws IOException
Schema. This method reads an integer as the size of
a chunk, followed by reading that many array element using the element schema, following by reading the size
of the next chunk, until it reads 0.
Sub-class can override this to have different behavior.decoder - The decode to decode value fromelementSchema - The Schema of the array elementsCollection containing all array elementsIOException - If failed to decodeprotected Map<?,?> decodeMap(Decoder decoder, co.cask.cdap.api.data.schema.Schema keySchema, co.cask.cdap.api.data.schema.Schema valueSchema) throws IOException
0.
Sub-class can override this to have different behavior.decoder - The decode to decode value fromkeySchema - The Schema of the map keyvalueSchema - The Schema of the map valueMap containing all map entriesIOException - If failed to decodeprotected co.cask.cdap.api.data.format.StructuredRecord decodeRecord(Decoder decoder, co.cask.cdap.api.data.schema.Schema schema) throws IOException
decoder - The decode to decode value fromschema - The Schema of the recordStructuredRecord representing the record decodedIOException - If failed to decodeprotected Object decodeUnion(Decoder decoder, co.cask.cdap.api.data.schema.Schema schema) throws IOException
decoder - The decode to decode value fromschema - The Schema of the unionIOException - If failed to decodeCopyright © 2018 Cask Data, Inc. Licensed under the Apache License, Version 2.0.