Saving all output to "!!{outputDirectory}!!/index_auto_mult_tables.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/index_auto_mult_tables.q >>> -- try the query without indexing, with manual indexing, and with automatic indexing >>> >>> -- without indexing >>> EXPLAIN SELECT a.key, a.value FROM src a JOIN srcpart b ON (a.key = b.key) WHERE a.key > 80 AND a.key < 100 AND b.key > 70 AND b.key < 90 ORDER BY a.key; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME src) a) (TOK_TABREF (TOK_TABNAME srcpart) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) value))) (TOK_WHERE (AND (AND (AND (> (. (TOK_TABLE_OR_COL a) key) 80) (< (. (TOK_TABLE_OR_COL a) key) 100)) (> (. (TOK_TABLE_OR_COL b) key) 70)) (< (. (TOK_TABLE_OR_COL b) key) 90))) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL a) key)))))' '' 'STAGE DEPENDENCIES:' ' Stage-1 is a root stage' ' Stage-2 depends on stages: Stage-1' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' a ' ' TableScan' ' alias: a' ' Filter Operator' ' predicate:' ' expr: ((((key > 80.0) and (key < 100.0)) and (key > 70.0)) and (key < 90.0))' ' type: boolean' ' Reduce Output Operator' ' key expressions:' ' expr: key' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: key' ' type: string' ' tag: 0' ' value expressions:' ' expr: key' ' type: string' ' expr: value' ' type: string' ' b ' ' TableScan' ' alias: b' ' Filter Operator' ' predicate:' ' expr: ((((key > 70.0) and (key < 90.0)) and (key > 80.0)) and (key < 100.0))' ' type: boolean' ' Reduce Output Operator' ' key expressions:' ' expr: key' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: key' ' type: string' ' tag: 1' ' value expressions:' ' expr: key' ' type: string' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col0} {VALUE._col1}' ' 1 {VALUE._col0}' ' handleSkewJoin: false' ' outputColumnNames: _col0, _col1, _col4' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: string' ' outputColumnNames: _col0, _col1' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' '' ' Stage: Stage-2' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' 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-0' ' Fetch Operator' ' limit: -1' '' '' 104 rows selected >>> SELECT a.key, a.value FROM src a JOIN srcpart b ON (a.key = b.key) WHERE a.key > 80 AND a.key < 100 AND b.key > 70 AND b.key < 90 ORDER BY a.key; 'key','value' '82','val_82' '82','val_82' '82','val_82' '82','val_82' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '85','val_85' '85','val_85' '85','val_85' '85','val_85' '86','val_86' '86','val_86' '86','val_86' '86','val_86' '87','val_87' '87','val_87' '87','val_87' '87','val_87' 48 rows selected >>> >>> >>> CREATE INDEX src_index ON TABLE src(key) as 'BITMAP' WITH DEFERRED REBUILD; No rows affected >>> ALTER INDEX src_index ON src REBUILD; No rows affected >>> >>> CREATE INDEX srcpart_index ON TABLE srcpart(key) as 'BITMAP' WITH DEFERRED REBUILD; No rows affected >>> ALTER INDEX srcpart_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 a.key, a.value FROM src a JOIN srcpart b ON (a.key = b.key) WHERE a.key > 80 AND a.key < 100 AND b.key > 70 AND b.key < 90 ORDER BY a.key; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME src) a) (TOK_TABREF (TOK_TABNAME srcpart) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) value))) (TOK_WHERE (AND (AND (AND (> (. (TOK_TABLE_OR_COL a) key) 80) (< (. (TOK_TABLE_OR_COL a) key) 100)) (> (. (TOK_TABLE_OR_COL b) key) 70)) (< (. (TOK_TABLE_OR_COL b) key) 90))) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL a) key)))))' '' 'STAGE DEPENDENCIES:' ' Stage-5 is a root stage' ' Stage-4 depends on stages: Stage-5' ' Stage-1 depends on stages: Stage-4, Stage-6' ' Stage-2 depends on stages: Stage-1' ' Stage-7 is a root stage' ' Stage-6 depends on stages: Stage-7' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-5' ' Map Reduce' ' Alias -> Map Operator Tree:' ' tmp_index:ind0:index_auto_mult_tables__srcpart_srcpart_index__ ' ' TableScan' ' alias: index_auto_mult_tables__srcpart_srcpart_index__' ' filterExpr:' ' expr: (((((key > 70.0) and (key < 90.0)) and (key > 80.0)) and (key < 100.0)) and (not EWAH_BITMAP_EMPTY(_bitmaps)))' ' type: boolean' ' Filter Operator' ' predicate:' ' expr: (((((key > 70.0) and (key < 90.0)) and (key > 80.0)) and (key < 100.0)) and (not EWAH_BITMAP_EMPTY(_bitmaps)))' ' type: boolean' ' Select Operator' ' expressions:' ' expr: _bucketname' ' type: string' ' expr: _offset' ' type: bigint' ' expr: _bitmaps' ' type: array' ' outputColumnNames: _col1, _col2, _col3' ' Select Operator' ' expressions:' ' expr: _col1' ' type: string' ' expr: _col2' ' type: bigint' ' outputColumnNames: _col0, _col1' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: bigint' ' outputColumnNames: _col0, _col1' ' Group By Operator' ' aggregations:' ' expr: collect_set(_col1)' ' bucketGroup: false' ' keys:' ' expr: _col0' ' type: string' ' mode: hash' ' outputColumnNames: _col0, _col1' ' Reduce Output Operator' ' key expressions:' ' expr: _col0' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: _col0' ' type: string' ' tag: -1' ' value expressions:' ' expr: _col1' ' type: array' ' Reduce Operator Tree:' ' Group By Operator' ' aggregations:' ' expr: collect_set(VALUE._col0)' ' bucketGroup: false' ' keys:' ' expr: KEY._col0' ' type: string' ' mode: mergepartial' ' outputColumnNames: _col0, _col1' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' 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-4' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' a ' ' TableScan' ' alias: a' ' filterExpr:' ' expr: ((((key > 80.0) and (key < 100.0)) and (key > 70.0)) and (key < 90.0))' ' type: boolean' ' Filter Operator' ' predicate:' ' expr: ((((key > 80.0) and (key < 100.0)) and (key > 70.0)) and (key < 90.0))' ' type: boolean' ' Reduce Output Operator' ' key expressions:' ' expr: key' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: key' ' type: string' ' tag: 0' ' value expressions:' ' expr: key' ' type: string' ' expr: value' ' type: string' ' b ' ' TableScan' ' alias: b' ' filterExpr:' ' expr: ((((key > 70.0) and (key < 90.0)) and (key > 80.0)) and (key < 100.0))' ' type: boolean' ' Filter Operator' ' predicate:' ' expr: ((((key > 70.0) and (key < 90.0)) and (key > 80.0)) and (key < 100.0))' ' type: boolean' ' Reduce Output Operator' ' key expressions:' ' expr: key' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: key' ' type: string' ' tag: 1' ' value expressions:' ' expr: key' ' type: string' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Inner Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col0} {VALUE._col1}' ' 1 {VALUE._col0}' ' handleSkewJoin: false' ' outputColumnNames: _col0, _col1, _col4' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: string' ' outputColumnNames: _col0, _col1' ' File Output Operator' ' compressed: false' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' '' ' Stage: Stage-2' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' 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-7' ' Map Reduce' ' Alias -> Map Operator Tree:' ' tmp_index:ind0:index_auto_mult_tables__src_src_index__ ' ' TableScan' ' alias: index_auto_mult_tables__src_src_index__' ' filterExpr:' ' expr: (((((key > 80.0) and (key < 100.0)) and (key > 70.0)) and (key < 90.0)) and (not EWAH_BITMAP_EMPTY(_bitmaps)))' ' type: boolean' ' Filter Operator' ' predicate:' ' expr: (((((key > 80.0) and (key < 100.0)) and (key > 70.0)) and (key < 90.0)) and (not EWAH_BITMAP_EMPTY(_bitmaps)))' ' type: boolean' ' Select Operator' ' expressions:' ' expr: _bucketname' ' type: string' ' expr: _offset' ' type: bigint' ' expr: _bitmaps' ' type: array' ' outputColumnNames: _col1, _col2, _col3' ' Select Operator' ' expressions:' ' expr: _col1' ' type: string' ' expr: _col2' ' type: bigint' ' outputColumnNames: _col0, _col1' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: bigint' ' outputColumnNames: _col0, _col1' ' Group By Operator' ' aggregations:' ' expr: collect_set(_col1)' ' bucketGroup: false' ' keys:' ' expr: _col0' ' type: string' ' mode: hash' ' outputColumnNames: _col0, _col1' ' Reduce Output Operator' ' key expressions:' ' expr: _col0' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: _col0' ' type: string' ' tag: -1' ' value expressions:' ' expr: _col1' ' type: array' ' Reduce Operator Tree:' ' Group By Operator' ' aggregations:' ' expr: collect_set(VALUE._col0)' ' bucketGroup: false' ' keys:' ' expr: KEY._col0' ' type: string' ' mode: mergepartial' ' outputColumnNames: _col0, _col1' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' 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-6' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-0' ' Fetch Operator' ' limit: -1' '' '' 288 rows selected >>> SELECT a.key, a.value FROM src a JOIN srcpart b ON (a.key = b.key) WHERE a.key > 80 AND a.key < 100 AND b.key > 70 AND b.key < 90 ORDER BY a.key; 'key','value' '82','val_82' '82','val_82' '82','val_82' '82','val_82' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '83','val_83' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '84','val_84' '85','val_85' '85','val_85' '85','val_85' '85','val_85' '86','val_86' '86','val_86' '86','val_86' '86','val_86' '87','val_87' '87','val_87' '87','val_87' '87','val_87' 48 rows selected >>> >>> DROP INDEX src_index on src; No rows affected >>> DROP INDEX srcpart_index on src; No rows affected >>> !record