org.apache.hadoop.hive.ql.index.compact
Class CompactIndexHandler
java.lang.Object
org.apache.hadoop.hive.ql.index.AbstractIndexHandler
org.apache.hadoop.hive.ql.index.TableBasedIndexHandler
org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable, HiveIndexHandler
- Direct Known Subclasses:
- AggregateIndexHandler
public class CompactIndexHandler
- extends TableBasedIndexHandler
CompactIndexHandler
public CompactIndexHandler()
analyzeIndexDefinition
public void analyzeIndexDefinition(org.apache.hadoop.hive.metastore.api.Table baseTable,
org.apache.hadoop.hive.metastore.api.Index index,
org.apache.hadoop.hive.metastore.api.Table indexTable)
throws HiveException
- Description copied from interface:
HiveIndexHandler
- Requests that the handler validate an index definition and fill in
additional information about its stored representation.
- Parameters:
baseTable
- the definition of the table being indexedindex
- the definition of the index being createdindexTable
- a partial definition of the index table to be used for storing the
index representation, or null if usesIndexTable() returns false;
the handler can augment the index's storage descriptor (e.g. with
information about input/output format) and/or the index table's
definition (typically with additional columns containing the index
representation, e.g. pointers into HDFS).
- Throws:
HiveException
- if the index definition is invalid with respect to
either the base table or the supplied index table definition
generateIndexQuery
public void generateIndexQuery(List<org.apache.hadoop.hive.metastore.api.Index> indexes,
ExprNodeDesc predicate,
ParseContext pctx,
HiveIndexQueryContext queryContext)
- Description copied from interface:
HiveIndexHandler
- Generate the list of tasks required to run an index optimized sub-query for the
given predicate, using the given indexes. If multiple indexes are
provided, it is up to the handler whether to use none, one, some or all of
them. The supplied predicate may reference any of the columns from any of
the indexes. If the handler decides to use more than one index, it is
responsible for generating tasks to combine their search results
(e.g. performing a JOIN on the result).
queryContext
- contains results, such as query tasks and input configuration
checkQuerySize
public boolean checkQuerySize(long querySize,
HiveConf hiveConf)
- Description copied from interface:
HiveIndexHandler
- Check the size of an input query to make sure it fits within the bounds
- Specified by:
checkQuerySize
in interface HiveIndexHandler
- Overrides:
checkQuerySize
in class AbstractIndexHandler
- Parameters:
querySize
- size (in bytes) of the query in question
- Returns:
- true if query is within the bounds
usesIndexTable
public boolean usesIndexTable()
- Description copied from interface:
HiveIndexHandler
- Determines whether this handler implements indexes by creating an index
table.
- Specified by:
usesIndexTable
in interface HiveIndexHandler
- Overrides:
usesIndexTable
in class TableBasedIndexHandler
- 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
Copyright © 2014 The Apache Software Foundation. All rights reserved.