org.apache.hadoop.hive.ql.index.bitmap
Class BitmapIndexHandler

java.lang.Object
  extended by org.apache.hadoop.hive.ql.index.AbstractIndexHandler
      extended by org.apache.hadoop.hive.ql.index.TableBasedIndexHandler
          extended by org.apache.hadoop.hive.ql.index.bitmap.BitmapIndexHandler
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, HiveIndexHandler

public class BitmapIndexHandler
extends TableBasedIndexHandler

Index handler for the bitmap index. Bitmap index uses an EWAH-compressed bitmap to represent the values in a table.


Constructor Summary
BitmapIndexHandler()
           
 
Method Summary
 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)
          Requests that the handler validate an index definition and fill in additional information about its stored representation.
 boolean checkQuerySize(long querySize, HiveConf hiveConf)
          Check the size of an input query to make sure it fits within the bounds
 void generateIndexQuery(List<org.apache.hadoop.hive.metastore.api.Index> indexes, ExprNodeDesc predicate, ParseContext pctx, HiveIndexQueryContext queryContext)
          Generate the list of tasks required to run an index optimized sub-query for the given predicate, using the given indexes.
 boolean usesIndexTable()
          Determines whether this handler implements indexes by creating an index table.
 
Methods inherited from class org.apache.hadoop.hive.ql.index.TableBasedIndexHandler
generateIndexBuildTaskList, getConf, setConf
 
Methods inherited from class org.apache.hadoop.hive.ql.index.AbstractIndexHandler
generateIndexQuery, getColumnNames
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitmapIndexHandler

public BitmapIndexHandler()
Method Detail

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

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 indexed
index - the definition of the index being created
indexTable - 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

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.