Saving all output to "!!{outputDirectory}!!/join18_multi_distinct.q.raw". Enter "record" with no arguments to stop it. >>> !run !!{qFileDirectory}!!/join18_multi_distinct.q >>> EXPLAIN SELECT a.key, a.value, b.key, b.value1, b.value2 FROM ( SELECT src1.key as key, count(src1.value) AS value FROM src src1 group by src1.key ) a FULL OUTER JOIN ( SELECT src2.key as key, count(distinct(src2.value)) AS value1, count(distinct(src2.key)) AS value2 FROM src1 src2 group by src2.key ) b ON (a.key = b.key) ORDER BY a.key ASC, a.value ASC, b.key ASC, b.value1 ASC, b.value2 ASC; 'Explain' 'ABSTRACT SYNTAX TREE:' ' (TOK_QUERY (TOK_FROM (TOK_FULLOUTERJOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) src1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src1) key) key) (TOK_SELEXPR (TOK_FUNCTION count (. (TOK_TABLE_OR_COL src1) value)) value)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL src1) key)))) a) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src1) src2)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL src2) key) key) (TOK_SELEXPR (TOK_FUNCTIONDI count (. (TOK_TABLE_OR_COL src2) value)) value1) (TOK_SELEXPR (TOK_FUNCTIONDI count (. (TOK_TABLE_OR_COL src2) key)) value2)) (TOK_GROUPBY (. (TOK_TABLE_OR_COL src2) key)))) 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_SELEXPR (. (TOK_TABLE_OR_COL b) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) value1)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) value2))) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL a) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL a) value)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL b) key)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL b) value1)) (TOK_TABSORTCOLNAMEASC (. (TOK_TABLE_OR_COL b) value2)))))' '' 'STAGE DEPENDENCIES:' ' Stage-1 is a root stage' ' Stage-2 depends on stages: Stage-1, Stage-4' ' Stage-3 depends on stages: Stage-2' ' Stage-4 is a root stage' ' Stage-0 is a root stage' '' 'STAGE PLANS:' ' Stage: Stage-1' ' Map Reduce' ' Alias -> Map Operator Tree:' ' b:src2 ' ' TableScan' ' alias: src2' ' Select Operator' ' expressions:' ' expr: key' ' type: string' ' expr: value' ' type: string' ' outputColumnNames: key, value' ' Group By Operator' ' aggregations:' ' expr: count(DISTINCT value)' ' expr: count(DISTINCT key)' ' bucketGroup: false' ' keys:' ' expr: key' ' type: string' ' expr: value' ' type: string' ' mode: hash' ' outputColumnNames: _col0, _col1, _col2, _col3' ' Reduce Output Operator' ' key expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: string' ' sort order: ++' ' Map-reduce partition columns:' ' expr: _col0' ' type: string' ' tag: -1' ' value expressions:' ' expr: _col2' ' type: bigint' ' expr: _col3' ' type: bigint' ' Reduce Operator Tree:' ' Group By Operator' ' aggregations:' ' expr: count(DISTINCT KEY._col1:0._col0)' ' expr: count(DISTINCT KEY._col1:1._col0)' ' bucketGroup: false' ' keys:' ' expr: KEY._col1:1._col0' ' type: string' ' mode: mergepartial' ' outputColumnNames: _col0, _col1, _col2' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: bigint' ' expr: _col2' ' type: bigint' ' outputColumnNames: _col0, _col1, _col2' ' 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:' ' $INTNAME ' ' Reduce Output Operator' ' key expressions:' ' expr: _col0' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: _col0' ' type: string' ' tag: 1' ' value expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: bigint' ' expr: _col2' ' type: bigint' ' $INTNAME1 ' ' Reduce Output Operator' ' key expressions:' ' expr: _col0' ' type: string' ' sort order: +' ' Map-reduce partition columns:' ' expr: _col0' ' type: string' ' tag: 0' ' value expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: bigint' ' Reduce Operator Tree:' ' Join Operator' ' condition map:' ' Outer Join 0 to 1' ' condition expressions:' ' 0 {VALUE._col0} {VALUE._col1}' ' 1 {VALUE._col0} {VALUE._col1} {VALUE._col2}' ' handleSkewJoin: false' ' outputColumnNames: _col0, _col1, _col2, _col3, _col4' ' Select Operator' ' expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: bigint' ' expr: _col2' ' type: string' ' expr: _col3' ' type: bigint' ' expr: _col4' ' type: bigint' ' outputColumnNames: _col0, _col1, _col2, _col3, _col4' ' 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-3' ' Map Reduce' ' Alias -> Map Operator Tree:' ' file:!!{hive.exec.scratchdir}!! ' ' Reduce Output Operator' ' key expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: bigint' ' expr: _col2' ' type: string' ' expr: _col3' ' type: bigint' ' expr: _col4' ' type: bigint' ' sort order: +++++' ' tag: -1' ' value expressions:' ' expr: _col0' ' type: string' ' expr: _col1' ' type: bigint' ' expr: _col2' ' type: string' ' expr: _col3' ' type: bigint' ' expr: _col4' ' type: bigint' ' 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:' ' a:src1 ' ' TableScan' ' alias: src1' ' Select Operator' ' expressions:' ' expr: key' ' type: string' ' expr: value' ' type: string' ' outputColumnNames: key, value' ' Group By Operator' ' aggregations:' ' expr: count(value)' ' bucketGroup: false' ' keys:' ' expr: key' ' 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: bigint' ' Reduce Operator Tree:' ' Group By Operator' ' aggregations:' ' expr: count(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: bigint' ' 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-0' ' Fetch Operator' ' limit: -1' '' '' 244 rows selected >>> >>> SELECT a.key, a.value, b.key, b.value1, b.value2 FROM ( SELECT src1.key as key, count(src1.value) AS value FROM src src1 group by src1.key ) a FULL OUTER JOIN ( SELECT src2.key as key, count(distinct(src2.value)) AS value1, count(distinct(src2.key)) AS value2 FROM src1 src2 group by src2.key ) b ON (a.key = b.key) ORDER BY a.key ASC, a.value ASC, b.key ASC, b.value1 ASC, b.value2 ASC; 'key','value','key','value1','value2' '','','','1','0' '','','','1','0' '','','','1','0' '','','','1','1' '','','val_146','1','0' '','','val_150','1','0' '','','val_165','1','0' '','','val_193','1','0' '','','val_213','1','0' '','','val_238','1','0' '','','val_255','1','0' '','','val_265','1','0' '','','val_27','1','0' '','','val_273','1','0' '','','val_278','1','0' '','','val_311','1','0' '','','val_401','1','0' '','','val_406','1','0' '','','val_409','1','0' '','','val_484','1','0' '','','val_66','1','0' '','','val_98','1','0' '0','3','','','' '10','1','','','' '100','2','','','' '103','2','','','' '104','2','','','' '105','1','','','' '11','1','','','' '111','1','','','' '113','2','','','' '114','1','','','' '116','1','','','' '118','2','','','' '119','3','','','' '12','2','','','' '120','2','','','' '125','2','','','' '126','1','','','' '128','3','128','0','1' '129','2','','','' '131','1','','','' '133','1','','','' '134','2','','','' '136','1','','','' '137','2','','','' '138','4','','','' '143','1','','','' '145','1','','','' '146','2','146','0','1' '149','2','','','' '15','2','','','' '150','1','150','0','1' '152','2','','','' '153','1','','','' '155','1','','','' '156','1','','','' '157','1','','','' '158','1','','','' '160','1','','','' '162','1','','','' '163','1','','','' '164','2','','','' '165','2','','','' '166','1','','','' '167','3','','','' '168','1','','','' '169','4','','','' '17','1','','','' '170','1','','','' '172','2','','','' '174','2','','','' '175','2','','','' '176','2','','','' '177','1','','','' '178','1','','','' '179','2','','','' '18','2','','','' '180','1','','','' '181','1','','','' '183','1','','','' '186','1','','','' '187','3','','','' '189','1','','','' '19','1','','','' '190','1','','','' '191','2','','','' '192','1','','','' '193','3','','','' '194','1','','','' '195','2','','','' '196','1','','','' '197','2','','','' '199','3','','','' '2','1','','','' '20','1','','','' '200','2','','','' '201','1','','','' '202','1','','','' '203','2','','','' '205','2','','','' '207','2','','','' '208','3','','','' '209','2','','','' '213','2','213','0','1' '214','1','','','' '216','2','','','' '217','2','','','' '218','1','','','' '219','2','','','' '221','2','','','' '222','1','','','' '223','2','','','' '224','2','224','0','1' '226','1','','','' '228','1','','','' '229','2','','','' '230','5','','','' '233','2','','','' '235','1','','','' '237','2','','','' '238','2','238','0','1' '239','2','','','' '24','2','','','' '241','1','','','' '242','2','','','' '244','1','','','' '247','1','','','' '248','1','','','' '249','1','','','' '252','1','','','' '255','2','255','0','1' '256','2','','','' '257','1','','','' '258','1','','','' '26','2','','','' '260','1','','','' '262','1','','','' '263','1','','','' '265','2','','','' '266','1','','','' '27','1','','','' '272','2','','','' '273','3','273','0','1' '274','1','','','' '275','1','','','' '277','4','','','' '278','2','278','0','1' '28','1','','','' '280','2','','','' '281','2','','','' '282','2','','','' '283','1','','','' '284','1','','','' '285','1','','','' '286','1','','','' '287','1','','','' '288','2','','','' '289','1','','','' '291','1','','','' '292','1','','','' '296','1','','','' '298','3','','','' '30','1','','','' '302','1','','','' '305','1','','','' '306','1','','','' '307','2','','','' '308','1','','','' '309','2','','','' '310','1','','','' '311','3','311','0','1' '315','1','','','' '316','3','','','' '317','2','','','' '318','3','','','' '321','2','','','' '322','2','','','' '323','1','','','' '325','2','','','' '327','3','','','' '33','1','','','' '331','2','','','' '332','1','','','' '333','2','','','' '335','1','','','' '336','1','','','' '338','1','','','' '339','1','','','' '34','1','','','' '341','1','','','' '342','2','','','' '344','2','','','' '345','1','','','' '348','5','','','' '35','3','','','' '351','1','','','' '353','2','','','' '356','1','','','' '360','1','','','' '362','1','','','' '364','1','','','' '365','1','','','' '366','1','','','' '367','2','','','' '368','1','','','' '369','3','369','0','1' '37','2','','','' '373','1','','','' '374','1','','','' '375','1','','','' '377','1','','','' '378','1','','','' '379','1','','','' '382','2','','','' '384','3','','','' '386','1','','','' '389','1','','','' '392','1','','','' '393','1','','','' '394','1','','','' '395','2','','','' '396','3','','','' '397','2','','','' '399','2','','','' '4','1','','','' '400','1','','','' '401','5','401','0','1' '402','1','','','' '403','3','','','' '404','2','','','' '406','4','406','0','1' '407','1','','','' '409','3','','','' '41','1','','','' '411','1','','','' '413','2','','','' '414','2','','','' '417','3','','','' '418','1','','','' '419','1','','','' '42','2','','','' '421','1','','','' '424','2','','','' '427','1','','','' '429','2','','','' '43','1','','','' '430','3','','','' '431','3','','','' '432','1','','','' '435','1','','','' '436','1','','','' '437','1','','','' '438','3','','','' '439','2','','','' '44','1','','','' '443','1','','','' '444','1','','','' '446','1','','','' '448','1','','','' '449','1','','','' '452','1','','','' '453','1','','','' '454','3','','','' '455','1','','','' '457','1','','','' '458','2','','','' '459','2','','','' '460','1','','','' '462','2','','','' '463','2','','','' '466','3','','','' '467','1','','','' '468','4','','','' '469','5','','','' '47','1','','','' '470','1','','','' '472','1','','','' '475','1','','','' '477','1','','','' '478','2','','','' '479','1','','','' '480','3','','','' '481','1','','','' '482','1','','','' '483','1','','','' '484','1','','','' '485','1','','','' '487','1','','','' '489','4','','','' '490','1','','','' '491','1','','','' '492','2','','','' '493','1','','','' '494','1','','','' '495','1','','','' '496','1','','','' '497','1','','','' '498','3','','','' '5','3','','','' '51','2','','','' '53','1','','','' '54','1','','','' '57','1','','','' '58','2','','','' '64','1','','','' '65','1','','','' '66','1','66','0','1' '67','2','','','' '69','1','','','' '70','3','','','' '72','2','','','' '74','1','','','' '76','2','','','' '77','1','','','' '78','1','','','' '8','1','','','' '80','1','','','' '82','1','','','' '83','2','','','' '84','2','','','' '85','1','','','' '86','1','','','' '87','1','','','' '9','1','','','' '90','3','','','' '92','1','','','' '95','2','','','' '96','1','','','' '97','2','','','' '98','2','98','0','1' 331 rows selected >>> !record