Class OrcDataReader


public class OrcDataReader extends IntegrationReader
Read records from Apache ORC columnar files. See Apache ORC columnar storage.
  • Constructor Details

    • OrcDataReader

      public OrcDataReader(File file)
      Reads ORC data from a file.
    • OrcDataReader

      public OrcDataReader(Path path)
      Read ORC data from a Path.
  • Method Details

    • open

      public void open() throws DataException
      Description copied from class: DataEndpoint
      Makes this endpoint ready for reading or writing.
      Overrides:
      open in class IntegrationReader
      Throws:
      DataException
    • close

      public void close() throws DataException
      Description copied from class: DataEndpoint
      Indicates that this endpoint has finished reading or writing.
      Overrides:
      close in class DataEndpoint
      Throws:
      DataException
    • readImpl

      protected Record readImpl() throws Throwable
      Description copied from class: DataReader
      Overridden by subclasses to read the next record from this DataReader. The default implementation of DataReader.read() now insures that this method will not be called again after it returns a null.

      If no record is available, null will be returned.

      Contract for subclasses (see also docs/authoring/DataReader.md):

      Specified by:
      readImpl in class DataReader
      Throws:
      Throwable
    • getBatchSize

      public int getBatchSize()
      Indicates the maximum number of records to buffer when reading ORC data (default 1024).
    • setBatchSize

      public OrcDataReader setBatchSize(int batchSize)
      Indicates the maximum number of records to buffer when reading ORC data (default 1024).
    • getColumns

      public FieldList getColumns()
      Indicates the columns to read from ORC file.
    • setColumns

      public OrcDataReader setColumns(FieldList columns)
      Indicates the columns to read from ORC file.
    • getSchema

      public TypeDescription getSchema()
      Indicates the schema used to read the file.
    • setSchema

      public OrcDataReader setSchema(String schema)
      Indicates the schema used to read the file.
    • setSchema

      public OrcDataReader setSchema(TypeDescription schema)
      Indicates the schema used to read the file.
    • getConfig

      public Configuration getConfig()
      Returns the Orc configuration parameters.
    • setConfig

      public OrcDataReader setConfig(Configuration config)
      Sets the Orc configuration parameters.
    • isLineageSupported

      public boolean isLineageSupported()
      Description copied from class: DataReader
      Indicates if this reader can capture record and field lineage (false unless overridden by a reader that supports it).
      Overrides:
      isLineageSupported in class DataReader
    • addLineage

      protected Record addLineage(Record record)
      Description copied from class: DataReader
      Called by DataReader.read() for each record from DataReader.readImpl() while lineage is saved; the default copies recordLineage into every field along with its original index and name. Overrides set their source details on recordLineage first and end with super.addLineage(record).
      Overrides:
      addLineage in class DataReader
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Description copied from class: Endpoint
      Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.
      Overrides:
      addExceptionProperties in class DataReader
    • getPath

      public Path getPath()
      Returns the Path of the ORC file being read.