Saving all output to "!!{outputDirectory}!!/index_auto_partitioned.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/index_auto_partitioned.q >>> -- test automatic use of index on table with partitions >>> CREATE INDEX src_part_index ON TABLE srcpart(key) as 'COMPACT' WITH DEFERRED REBUILD; No rows affected >>> ALTER INDEX src_part_index ON srcpart REBUILD; No rows affected >>> >>> SET hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat; No rows affected >>> SET hive.optimize.index.filter=true; No rows affected >>> SET hive.optimize.index.filter.compact.minsize=0; No rows affected >>> >>> EXPLAIN SELECT key, value FROM srcpart WHERE key=86 AND ds='2008-04-09' ORDER BY key; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME srcpart))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL value))) (TOK_WHERE (AND (= (TOK_TABLE_OR_COL key) 86) (= (TOK_TABLE_OR_COL ds) '2008-04-09'))) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL key)))))' '' 'STAGE DEPENDENCIES:' ' Stage-3 is a root stage' ' Stage-8 depends on stages: Stage-3 , consists of Stage-5, Stage-4, Stage-6' ' Stage-5' ' Stage-2 depends on stages: Stage-5, Stage-4, Stage-7' ' Stage-1 depends on stages: Stage-2' ' Stage-4' ' Stage-6' ' Stage-7 depends on stages: Stage-6' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-3' ' Map Reduce' ' Alias -> Map Operator Tree:' ' index_auto_partitioned__srcpart_src_part_index__ ' ' TableScan' ' alias: index_auto_partitioned__srcpart_src_part_index__' ' filterExpr:' ' expr: ((key = 86.0) and (ds = '2008-04-09'))' ' type: boolean' ' Filter Operator' ' predicate:' ' expr: (key = 86.0)' ' type: boolean' ' Select Operator' ' expressions:' ' expr: _bucketname' ' type: string' ' expr: _offsets' ' type: array' ' outputColumnNames: _col0, _col1' ' File Output Operator' ' compressed: false' ' GlobalTableId: 1' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' '' ' Stage: Stage-8' ' Conditional Operator' '' ' Stage: Stage-5' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-2' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' srcpart ' ' TableScan' ' alias: srcpart' ' filterExpr:' ' expr: ((key = 86.0) and (ds = '2008-04-09'))' ' type: boolean' ' Filter Operator' ' predicate:' ' expr: (key = 86.0)' ' type: boolean' ' Select Operator' ' expressions:' ' expr: key' ' type: string' ' expr: value' ' type: string' ' outputColumnNames: _col0, _col1' ' Reduce Output Operator' ' key expressions:' ' expr: _col0' ' type: string' ' sort order: +' ' tag: -1' ' value expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: string' ' Reduce Operator Tree:' ' Extract' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' '' ' Stage: Stage-4' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' '' ' Stage: Stage-6' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' '' ' Stage: Stage-7' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-0' ' Fetch Operator' ' limit: -1' '' '' 130 rows selected >>> SELECT key, value FROM srcpart WHERE key=86 AND ds='2008-04-09' ORDER BY key; 'key','value' '86','val_86' '86','val_86' 2 rows selected >>> >>> DROP INDEX src_part_index ON srcpart; No rows affected >>> !record