org.apache.hadoop.hive.ql.io.orc
Interface RecordReader


public interface RecordReader

A row-by-row iterator for ORC files.


Method Summary
 void close()
          Release the resources associated with the given reader.
 float getProgress()
          Get the progress of the reader through the rows.
 long getRowNumber()
          Get the row number of the row that will be returned by the following call to next().
 boolean hasNext()
          Does the reader have more rows available.
 Object next(Object previous)
          Read the next row.
 VectorizedRowBatch nextBatch(VectorizedRowBatch previousBatch)
          Read the next row batch.
 void seekToRow(long rowCount)
          Seek to a particular row number.
 

Method Detail

hasNext

boolean hasNext()
                throws IOException
Does the reader have more rows available.

Returns:
true if there are more rows
Throws:
IOException

next

Object next(Object previous)
            throws IOException
Read the next row.

Parameters:
previous - a row object that can be reused by the reader
Returns:
the row that was read
Throws:
IOException

nextBatch

VectorizedRowBatch nextBatch(VectorizedRowBatch previousBatch)
                             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 retunred object to know the batch size read.

Parameters:
previousBatch - a row batch object that can be reused by the reader
Returns:
the row batch that was read
Throws:
IOException

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

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

close

void close()
           throws IOException
Release the resources associated with the given reader.

Throws:
IOException

seekToRow

void seekToRow(long rowCount)
               throws IOException
Seek to a particular row number.

Throws:
IOException


Copyright © 2014 The Apache Software Foundation. All rights reserved.