Interface RecordReader

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
RecordReaderImpl

public interface RecordReader extends Closeable
A row-by-row iterator for ORC files.
Since:
1.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Release the resources associated with the given reader.
    float
    Get the progress of the reader through the rows.
    long
    Get the row number of the row that will be returned by the following call to next().
    boolean
    nextBatch(org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch batch)
    Read the next row batch.
    void
    seekToRow(long rowCount)
    Seek to a particular row number.
  • Method Details

    • nextBatch

      boolean nextBatch(org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch batch) throws IOException
      Read the next row batch. The size of the batch to read cannot be controlled by the callers. Caller need to look at VectorizedRowBatch.size of the returned object to know the batch size read.
      Parameters:
      batch - a row batch object to read into
      Returns:
      were more rows available to read?
      Throws:
      IOException
      Since:
      1.1.0
    • getRowNumber

      long getRowNumber() throws IOException
      Get the row number of the row that will be returned by the following call to next().
      Returns:
      the row number from 0 to the number of rows in the file
      Throws:
      IOException
      Since:
      1.1.0
    • getProgress

      float getProgress() throws IOException
      Get the progress of the reader through the rows.
      Returns:
      a fraction between 0.0 and 1.0 of rows read
      Throws:
      IOException
      Since:
      1.1.0
    • close

      void close() throws IOException
      Release the resources associated with the given reader.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
      Since:
      1.1.0
    • seekToRow

      void seekToRow(long rowCount) throws IOException
      Seek to a particular row number.
      Throws:
      IOException
      Since:
      1.1.0