Saving all output to "!!{outputDirectory}!!/rcfile_merge2.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/rcfile_merge2.q >>> set hive.merge.rcfile.block.level=true; No rows affected >>> set hive.exec.dynamic.partition=true; No rows affected >>> set mapred.max.split.size=100; No rows affected >>> set mapred.min.split.size=1; No rows affected >>> >>> DROP TABLE rcfile_merge2a; No rows affected >>> >>> CREATE TABLE rcfile_merge2a (key INT, value STRING) PARTITIONED BY (one string, two string, three string) STORED AS RCFILE; No rows affected >>> >>> EXPLAIN INSERT OVERWRITE TABLE rcfile_merge2a PARTITION (one='1', two, three) SELECT key, value, PMOD(HASH(key), 10) as two, PMOD(HASH(value), 10) as three FROM src; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME rcfile_merge2a) (TOK_PARTSPEC (TOK_PARTVAL one '1') (TOK_PARTVAL two) (TOK_PARTVAL three)))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL value)) (TOK_SELEXPR (TOK_FUNCTION PMOD (TOK_FUNCTION HASH (TOK_TABLE_OR_COL key)) 10) two) (TOK_SELEXPR (TOK_FUNCTION PMOD (TOK_FUNCTION HASH (TOK_TABLE_OR_COL value)) 10) three))))' '' 'STAGE DEPENDENCIES:' ' Stage-1 is a root stage' ' Stage-7 depends on stages: Stage-1 , consists of Stage-4, Stage-3, Stage-5' ' Stage-4' ' Stage-0 depends on stages: Stage-4, Stage-3, Stage-6' ' Stage-2 depends on stages: Stage-0' ' Stage-3' ' Stage-5' ' Stage-6 depends on stages: Stage-5' '' 'STAGE PLANS:' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' src ' ' TableScan' ' alias: src' ' Select Operator' ' expressions:' ' expr: key' ' type: string' ' expr: value' ' type: string' ' expr: pmod(hash(key), 10)' ' type: int' ' expr: pmod(hash(value), 10)' ' type: int' ' outputColumnNames: _col0, _col1, _col2, _col3' ' Select Operator' ' expressions:' ' expr: UDFToInteger(_col0)' ' type: int' ' expr: _col1' ' type: string' ' expr: _col2' ' type: int' ' expr: _col3' ' type: int' ' outputColumnNames: _col0, _col1, _col2, _col3' ' File Output Operator' ' compressed: false' ' GlobalTableId: 1' ' table:' ' input format: org.apache.hadoop.hive.ql.io.RCFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.RCFileOutputFormat' ' serde: org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe' ' name: rcfile_merge2.rcfile_merge2a' '' ' Stage: Stage-7' ' Conditional Operator' '' ' Stage: Stage-4' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: pfile:!!{hive.exec.scratchdir}!!' '' ' Stage: Stage-0' ' Move Operator' ' tables:' ' partition:' ' one 1' ' three ' ' two ' ' replace: true' ' table:' ' input format: org.apache.hadoop.hive.ql.io.RCFileInputFormat' ' output format: org.apache.hadoop.hive.ql.io.RCFileOutputFormat' ' serde: org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe' ' name: rcfile_merge2.rcfile_merge2a' '' ' Stage: Stage-2' ' Stats-Aggr Operator' '' ' Stage: Stage-3' ' Block level merge' '' ' Stage: Stage-5' ' Block level merge' '' ' Stage: Stage-6' ' Move Operator' ' files:' ' hdfs directory: true' ' destination: pfile:!!{hive.exec.scratchdir}!!' '' '' 90 rows selected >>> INSERT OVERWRITE TABLE rcfile_merge2a PARTITION (one='1', two, three) SELECT key, value, PMOD(HASH(key), 10) as two, PMOD(HASH(value), 10) as three FROM src; '_col0','_col1','_col2','_col3' No rows selected >>> >>> SELECT SUM(HASH(c)) FROM ( SELECT TRANSFORM(*) USING 'tr \t _' AS (c) FROM rcfile_merge2a ) t; '_c0' '-4209012844' 1 row selected >>> SELECT SUM(HASH(c)) FROM ( SELECT TRANSFORM(key, value, '1', PMOD(HASH(key), 10), PMOD(HASH(value), 10)) USING 'tr \t _' AS (c) FROM src ) t; '_c0' '-4209012844' 1 row selected >>> >>> DROP TABLE rcfile_merge2a; No rows affected >>> >>> !record