Class HiveTextRecordReader
java.lang.Object
org.apache.drill.exec.store.AbstractRecordReader
org.apache.drill.exec.store.hive.readers.HiveDefaultRecordReader
org.apache.drill.exec.store.hive.readers.HiveTextRecordReader
- All Implemented Interfaces:
AutoCloseable
,RecordReader
Reading of Hive table stored in text format may require to skip few header/footer records.
This class extends default reader to add the functionality.
-
Field Summary
Fields inherited from class org.apache.drill.exec.store.hive.readers.HiveDefaultRecordReader
empty, logger, mapredReader, outputWriter, partitionDeserializer, partitionToTableSchemaConverter, TARGET_RECORD_COUNT, valueHolder
Fields inherited from class org.apache.drill.exec.store.AbstractRecordReader
DEFAULT_TEXT_COLS_TO_READ
Fields inherited from interface org.apache.drill.exec.store.RecordReader
ALLOCATOR_INITIAL_RESERVATION, ALLOCATOR_MAX_RESERVATION
-
Constructor Summary
ConstructorDescriptionHiveTextRecordReader
(HiveTableWithColumnCache table, HivePartition partition, Collection<org.apache.hadoop.mapred.InputSplit> inputSplits, List<SchemaPath> projectedColumns, FragmentContext context, org.apache.hadoop.hive.conf.HiveConf hiveConf, org.apache.hadoop.security.UserGroupInformation proxyUgi) Constructor matching super. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
internalInit
(Properties hiveTableProperties) Default implementation does nothing, used to apply skip header/footer functionalityint
next()
Reads batch of records skipping footer rows when necessary.Methods inherited from class org.apache.drill.exec.store.hive.readers.HiveDefaultRecordReader
close, hasNextValue, readHiveRecordAndInsertIntoRecordBatch, setup
Methods inherited from class org.apache.drill.exec.store.AbstractRecordReader
allocate, getColumns, getDefaultColumnsToRead, hasNext, isSkipQuery, isStarQuery, setColumns, toString, transformColumns
-
Constructor Details
-
HiveTextRecordReader
public HiveTextRecordReader(HiveTableWithColumnCache table, HivePartition partition, Collection<org.apache.hadoop.mapred.InputSplit> inputSplits, List<SchemaPath> projectedColumns, FragmentContext context, org.apache.hadoop.hive.conf.HiveConf hiveConf, org.apache.hadoop.security.UserGroupInformation proxyUgi) Constructor matching super.- Parameters:
table
- metadata about Hive table being readpartition
- holder of metadata about table partitioninginputSplits
- input splits for reading data from distributed storageprojectedColumns
- target columns for scancontext
- fragmentContext of fragmenthiveConf
- Hive configurationproxyUgi
- user/group info to be used for initialization
-
-
Method Details
-
internalInit
Description copied from class:HiveDefaultRecordReader
Default implementation does nothing, used to apply skip header/footer functionality- Overrides:
internalInit
in classHiveDefaultRecordReader
- Parameters:
hiveTableProperties
- hive table properties
-
next
public int next()Reads batch of records skipping footer rows when necessary.- Specified by:
next
in interfaceRecordReader
- Overrides:
next
in classHiveDefaultRecordReader
- Returns:
- count of read records
-