Saving all output to "!!{outputDirectory}!!/groupby7_noskew_multi_single_reducer.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/groupby7_noskew_multi_single_reducer.q >>> set hive.map.aggr=false; No rows affected >>> set hive.groupby.skewindata=false; No rows affected >>> set mapred.reduce.tasks=31; No rows affected >>> >>> CREATE TABLE DEST1(key INT, value STRING) STORED AS TEXTFILE; No rows affected >>> CREATE TABLE DEST2(key INT, value STRING) STORED AS TEXTFILE; No rows affected >>> >>> SET hive.exec.compress.intermediate=true; No rows affected >>> SET hive.exec.compress.output=true; No rows affected >>> >>> EXPLAIN FROM SRC INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key limit 10 INSERT OVERWRITE TABLE DEST2 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key limit 10; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME SRC))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME DEST1))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL SRC) key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION SUBSTR (. (TOK_TABLE_OR_COL SRC) value) 5)))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL SRC) key)) (TOK_LIMIT 10)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME DEST2))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL SRC) key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION SUBSTR (. (TOK_TABLE_OR_COL SRC) value) 5)))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL SRC) key)) (TOK_LIMIT 10)))' '' 'STAGE DEPENDENCIES:' ' Stage-2 is a root stage' ' Stage-3 depends on stages: Stage-2' ' Stage-0 depends on stages: Stage-3' ' Stage-4 depends on stages: Stage-0' ' Stage-5 depends on stages: Stage-2' ' Stage-1 depends on stages: Stage-5' ' Stage-6 depends on stages: Stage-1' '' 'STAGE PLANS:' ' Stage: Stage-2' ' Map Reduce' ' Alias -> Map Operator Tree:' ' src ' ' TableScan' ' alias: src' ' Select Operator' ' expressions:' ' expr: key' ' type: string' ' expr: value' ' type: string' ' outputColumnNames: key, value' ' Reduce Output Operator' ' key expressions:' ' expr: key' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: key' ' type: string' ' tag: -1' ' value expressions:' ' expr: substr(value, 5)' ' type: string' ' Reduce Operator Tree:' ' Forward' ' Group By Operator' ' aggregations:' ' expr: sum(VALUE._col0)' ' bucketGroup: false' ' keys:' ' expr: KEY._col0' ' type: string' ' mode: complete' ' outputColumnNames: _col0, _col1' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: double' ' outputColumnNames: _col0, _col1' ' Limit' ' File Output Operator' ' compressed: true' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' ' Group By Operator' ' aggregations:' ' expr: sum(VALUE._col0)' ' bucketGroup: false' ' keys:' ' expr: KEY._col0' ' type: string' ' mode: complete' ' outputColumnNames: _col0, _col1' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: double' ' outputColumnNames: _col0, _col1' ' Limit' ' File Output Operator' ' compressed: true' ' GlobalTableId: 0' ' table:' ' input format: org.apache.hadoop.mapred.SequenceFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat' '' ' Stage: Stage-3' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' Reduce Output Operator' ' sort order: ' ' tag: -1' ' value expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: double' ' Reduce Operator Tree:' ' Extract' ' Limit' ' Select Operator' ' expressions:' ' expr: UDFToInteger(_col0)' ' type: int' ' expr: _col1' ' type: double' ' outputColumnNames: _col0, _col1' ' File Output Operator' ' compressed: true' ' GlobalTableId: 1' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: groupby7_noskew_multi_single_reducer.dest1' '' ' Stage: Stage-0' ' Move Operator' ' tables:' ' replace: true' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: groupby7_noskew_multi_single_reducer.dest1' '' ' Stage: Stage-4' ' Stats-Aggr Operator' '' ' Stage: Stage-5' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' Reduce Output Operator' ' sort order: ' ' tag: -1' ' value expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: double' ' Reduce Operator Tree:' ' Extract' ' Limit' ' Select Operator' ' expressions:' ' expr: UDFToInteger(_col0)' ' type: int' ' expr: _col1' ' type: double' ' outputColumnNames: _col0, _col1' ' File Output Operator' ' compressed: true' ' GlobalTableId: 2' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: groupby7_noskew_multi_single_reducer.dest2' '' ' Stage: Stage-1' ' Move Operator' ' tables:' ' replace: true' ' table:' ' input format: org.apache.hadoop.mapred.TextInputFormat' ' output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ' serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' ' name: groupby7_noskew_multi_single_reducer.dest2' '' ' Stage: Stage-6' ' Stats-Aggr Operator' '' '' 176 rows selected >>> >>> FROM SRC INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key limit 10 INSERT OVERWRITE TABLE DEST2 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key limit 10; '_col0','_col1' No rows selected >>> >>> SELECT DEST1.* FROM DEST1 ORDER BY key ASC, value ASC; 'key','value' '0','0.0' '10','10.0' '11','11.0' '100','200.0' '103','206.0' '104','208.0' '105','105.0' '111','111.0' '113','226.0' '114','114.0' 10 rows selected >>> SELECT DEST2.* FROM DEST2 ORDER BY key ASC, value ASC; 'key','value' '0','0.0' '10','10.0' '11','11.0' '100','200.0' '103','206.0' '104','208.0' '105','105.0' '111','111.0' '113','226.0' '114','114.0' 10 rows selected >>> !record