Saving all output to "!!{outputDirectory}!!/index_auto_mult_tables_compact.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/index_auto_mult_tables_compact.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 'COMPACT' 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 'COMPACT' 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 >>> >>> -- automatic 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-5 is a root stage' ' Stage-10 depends on stages: Stage-5 , consists of Stage-7, Stage-6, Stage-8' ' Stage-7' ' Stage-4 depends on stages: Stage-7, Stage-6, Stage-9' ' Stage-1 depends on stages: Stage-4, Stage-11' ' Stage-2 depends on stages: Stage-1' ' Stage-6' ' Stage-8' ' Stage-9 depends on stages: Stage-8' ' Stage-12 is a root stage' ' Stage-17 depends on stages: Stage-12 , consists of Stage-14, Stage-13, Stage-15' ' Stage-14' ' Stage-11 depends on stages: Stage-14, Stage-13, Stage-16' ' Stage-13' ' Stage-15' ' Stage-16 depends on stages: Stage-15' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-5' ' Map Reduce' ' Alias -> Map Operator Tree:' ' index_auto_mult_tables_compact__srcpart_srcpart_index__ ' ' TableScan' ' alias: index_auto_mult_tables_compact__srcpart_srcpart_index__' ' 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' ' 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-10' ' Conditional Operator' '' ' Stage: Stage-7' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' 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-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-8' ' 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-9' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-12' ' Map Reduce' ' Alias -> Map Operator Tree:' ' index_auto_mult_tables_compact__src_src_index__ ' ' TableScan' ' alias: index_auto_mult_tables_compact__src_src_index__' ' 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' ' 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-17' ' Conditional Operator' '' ' Stage: Stage-14' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-11' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-13' ' 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-15' ' 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-16' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: file:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-0' ' Fetch Operator' ' limit: -1' '' '' 264 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