org.apache.hadoop.hive.ql.index
Class TableBasedIndexHandler
java.lang.Object
org.apache.hadoop.hive.ql.index.AbstractIndexHandler
org.apache.hadoop.hive.ql.index.TableBasedIndexHandler
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable, HiveIndexHandler
- Direct Known Subclasses:
- BitmapIndexHandler, CompactIndexHandler
public abstract class TableBasedIndexHandler
- extends AbstractIndexHandler
Index handler for indexes that use tables to store indexes.
Field Summary |
protected org.apache.hadoop.conf.Configuration |
configuration
|
Method Summary |
List<Task<?>> |
generateIndexBuildTaskList(Table baseTbl,
Index index,
List<Partition> indexTblPartitions,
List<Partition> baseTblPartitions,
Table indexTbl,
Set<ReadEntity> inputs,
Set<WriteEntity> outputs)
Requests that the handler generate a plan for building the index; the plan
should read the base table and write out the index representation. |
org.apache.hadoop.conf.Configuration |
getConf()
|
protected abstract Task<?> |
getIndexBuilderMapRedTask(Set<ReadEntity> inputs,
Set<WriteEntity> outputs,
List<FieldSchema> indexField,
boolean partitioned,
PartitionDesc indexTblPartDesc,
String indexTableName,
PartitionDesc baseTablePartDesc,
String baseTableName,
String dbName)
|
protected List<String> |
getPartKVPairStringArray(LinkedHashMap<String,String> partSpec)
|
void |
setConf(org.apache.hadoop.conf.Configuration conf)
|
boolean |
usesIndexTable()
Determines whether this handler implements indexes by creating an index
table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
configuration
protected org.apache.hadoop.conf.Configuration configuration
TableBasedIndexHandler
public TableBasedIndexHandler()
generateIndexBuildTaskList
public List<Task<?>> generateIndexBuildTaskList(Table baseTbl,
Index index,
List<Partition> indexTblPartitions,
List<Partition> baseTblPartitions,
Table indexTbl,
Set<ReadEntity> inputs,
Set<WriteEntity> outputs)
throws HiveException
- Description copied from interface:
HiveIndexHandler
- Requests that the handler generate a plan for building the index; the plan
should read the base table and write out the index representation.
- Parameters:
baseTbl
- the definition of the table being indexedindex
- the definition of the indexbaseTblPartitions
- list of base table partitions with each element mirrors to the
corresponding one in indexTblPartitionsindexTbl
- the definition of the index table, or null if usesIndexTable()
returns nullinputs
- inputs for hooks, supplemental outputs going
along with the return valueoutputs
- outputs for hooks, supplemental outputs going
along with the return value
- Returns:
- list of tasks to be executed in parallel for building the index
- Throws:
HiveException
- if plan generation fails
getIndexBuilderMapRedTask
protected abstract Task<?> getIndexBuilderMapRedTask(Set<ReadEntity> inputs,
Set<WriteEntity> outputs,
List<FieldSchema> indexField,
boolean partitioned,
PartitionDesc indexTblPartDesc,
String indexTableName,
PartitionDesc baseTablePartDesc,
String baseTableName,
String dbName)
throws HiveException
- Throws:
HiveException
getPartKVPairStringArray
protected List<String> getPartKVPairStringArray(LinkedHashMap<String,String> partSpec)
usesIndexTable
public boolean usesIndexTable()
- Description copied from interface:
HiveIndexHandler
- Determines whether this handler implements indexes by creating an index
table.
- Returns:
- true if index creation implies creation of an index table in Hive;
false if the index representation is not stored in a Hive table
getConf
public org.apache.hadoop.conf.Configuration getConf()
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf)
Copyright © 2013 The Apache Software Foundation