Class HBaseRecordReader
java.lang.Object
org.apache.drill.exec.store.AbstractRecordReader
org.apache.drill.exec.store.hbase.HBaseRecordReader
- All Implemented Interfaces:
AutoCloseable,DrillHBaseConstants,RecordReader
-
Field Summary
Fields inherited from class org.apache.drill.exec.store.AbstractRecordReader
DEFAULT_TEXT_COLS_TO_READFields inherited from interface org.apache.drill.exec.store.hbase.DrillHBaseConstants
COLUMN_FAMILY_TYPE, COLUMN_TYPE, HBASE_ZOOKEEPER_PORT, ROW_KEY, ROW_KEY_PATH, ROW_KEY_TYPE, SYS_STORE_PROVIDER_HBASE_CONFIG, SYS_STORE_PROVIDER_HBASE_TABLEFields inherited from interface org.apache.drill.exec.store.RecordReader
ALLOCATOR_INITIAL_RESERVATION, ALLOCATOR_MAX_RESERVATION -
Constructor Summary
ConstructorsConstructorDescriptionHBaseRecordReader(org.apache.hadoop.hbase.client.Connection connection, HBaseSubScan.HBaseSubScanSpec subScanSpec, List<SchemaPath> projectedColumns) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intnext()Increments this record reader forward, writing via the provided output mutator into the output batch.voidsetup(OperatorContext context, OutputMutator output) Configure the RecordReader with the provided schema and the record batch that should be written to.toString()protected Collection<SchemaPath> transformColumns(Collection<SchemaPath> columns) Provides the projected columns information to the Hbase Scan instance.Methods inherited from class org.apache.drill.exec.store.AbstractRecordReader
allocate, getColumns, getDefaultColumnsToRead, hasNext, isSkipQuery, isStarQuery, setColumns
-
Constructor Details
-
HBaseRecordReader
public HBaseRecordReader(org.apache.hadoop.hbase.client.Connection connection, HBaseSubScan.HBaseSubScanSpec subScanSpec, List<SchemaPath> projectedColumns)
-
-
Method Details
-
transformColumns
Provides the projected columns information to the Hbase Scan instance. If the projected columns list contains a column family and also a column in the column family, only the column family is passed to the Scan instance. For example, if the projection list is {cf1, cf1.col1, cf2.col1} then we only pass {cf1, cf2.col1} to the Scan instance.- Overrides:
transformColumnsin classAbstractRecordReader- Parameters:
columns- collection of projected columns- Returns:
- collection of projected column family names
-
setup
Description copied from interface:RecordReaderConfigure the RecordReader with the provided schema and the record batch that should be written to.- Specified by:
setupin interfaceRecordReader- Parameters:
context- operator context for the readeroutput- The place where output for a particular scan should be written. The record reader is responsible for mutating the set of schema values for that particular record.- Throws:
ExecutionSetupException
-
next
public int next()Description copied from interface:RecordReaderIncrements this record reader forward, writing via the provided output mutator into the output batch.- Specified by:
nextin interfaceRecordReader- Returns:
- The number of additional records added to the output.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
toString
- Overrides:
toStringin classAbstractRecordReader
-