Index: ql/src/test/results/clientpositive/groupby_ppd.q.out =================================================================== --- ql/src/test/results/clientpositive/groupby_ppd.q.out (revision 0) +++ ql/src/test/results/clientpositive/groupby_ppd.q.out (revision 0) @@ -0,0 +1,161 @@ +PREHOOK: query: -- see HIVE-2382 +create table invites (id int, foo int, bar int) +PREHOOK: type: CREATETABLE +POSTHOOK: query: -- see HIVE-2382 +create table invites (id int, foo int, bar int) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@invites +PREHOOK: query: explain select * from (select foo, bar from (select bar, foo from invites c union all select bar, foo from invites d) b) a group by bar, foo having bar=1 +PREHOOK: type: QUERY +POSTHOOK: query: explain select * from (select foo, bar from (select bar, foo from invites c union all select bar, foo from invites d) b) a group by bar, foo having bar=1 +POSTHOOK: type: QUERY +ABSTRACT SYNTAX TREE: + (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_UNION (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME invites) c)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL bar)) (TOK_SELEXPR (TOK_TABLE_OR_COL foo))))) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME invites) d)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL bar)) (TOK_SELEXPR (TOK_TABLE_OR_COL foo)))))) b)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL foo)) (TOK_SELEXPR (TOK_TABLE_OR_COL bar))))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_GROUPBY (TOK_TABLE_OR_COL bar) (TOK_TABLE_OR_COL foo)) (TOK_HAVING (= (TOK_TABLE_OR_COL bar) 1)))) + +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Alias -> Map Operator Tree: + a-subquery1:b-subquery1:c + TableScan + alias: c + Filter Operator + predicate: + expr: (bar = 1) + type: boolean + Select Operator + expressions: + expr: bar + type: int + expr: foo + type: int + outputColumnNames: _col0, _col1 + Union + Select Operator + expressions: + expr: _col1 + type: int + expr: _col0 + type: int + outputColumnNames: _col0, _col1 + Select Operator + expressions: + expr: _col0 + type: int + expr: _col1 + type: int + outputColumnNames: _col0, _col1 + Group By Operator + bucketGroup: false + keys: + expr: _col1 + type: int + expr: _col0 + type: int + mode: hash + outputColumnNames: _col0, _col1 + Reduce Output Operator + key expressions: + expr: _col0 + type: int + expr: _col1 + type: int + sort order: ++ + Map-reduce partition columns: + expr: _col0 + type: int + expr: _col1 + type: int + tag: -1 + a-subquery2:b-subquery2:d + TableScan + alias: d + Filter Operator + predicate: + expr: (bar = 1) + type: boolean + Select Operator + expressions: + expr: bar + type: int + expr: foo + type: int + outputColumnNames: _col0, _col1 + Union + Select Operator + expressions: + expr: _col1 + type: int + expr: _col0 + type: int + outputColumnNames: _col0, _col1 + Select Operator + expressions: + expr: _col0 + type: int + expr: _col1 + type: int + outputColumnNames: _col0, _col1 + Group By Operator + bucketGroup: false + keys: + expr: _col1 + type: int + expr: _col0 + type: int + mode: hash + outputColumnNames: _col0, _col1 + Reduce Output Operator + key expressions: + expr: _col0 + type: int + expr: _col1 + type: int + sort order: ++ + Map-reduce partition columns: + expr: _col0 + type: int + expr: _col1 + type: int + tag: -1 + Reduce Operator Tree: + Group By Operator + bucketGroup: false + keys: + expr: KEY._col0 + type: int + expr: KEY._col1 + type: int + mode: mergepartial + outputColumnNames: _col0, _col1 + Select Operator + expressions: + expr: _col0 + type: int + expr: _col1 + type: int + outputColumnNames: _col0, _col1 + 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 + + +PREHOOK: query: drop table invites +PREHOOK: type: DROPTABLE +PREHOOK: Input: default@invites +PREHOOK: Output: default@invites +POSTHOOK: query: drop table invites +POSTHOOK: type: DROPTABLE +POSTHOOK: Input: default@invites +POSTHOOK: Output: default@invites Index: ql/src/test/results/compiler/plan/groupby1.q.xml =================================================================== --- ql/src/test/results/compiler/plan/groupby1.q.xml (revision 1163362) +++ ql/src/test/results/compiler/plan/groupby1.q.xml (working copy) @@ -1,5 +1,5 @@ - + @@ -22,7 +22,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/scratchdir/hive_2011-04-28_23-52-57_564_8385471438034055340/-ext-10000/ + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/scratchdir/hive_2011-08-30_13-23-31_510_1697498805648472139/-ext-10000/ @@ -58,7 +58,7 @@ true - pfile:/data/users/sdong/www/open-source-hive1/build/ql/scratchdir/hive_2011-04-28_23-52-57_564_8385471438034055340/-ext-10000 + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/scratchdir/hive_2011-08-30_13-23-31_510_1697498805648472139/-ext-10000 @@ -111,11 +111,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/dest1 + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/dest1 transient_lastDdlTime - 1304059977 + 1314735811 @@ -125,7 +125,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/scratchdir/hive_2011-04-28_23-52-57_564_8385471438034055340/-ext-10001 + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/scratchdir/hive_2011-08-30_13-23-31_510_1697498805648472139/-ext-10001 @@ -196,11 +196,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059975 + 1314735810 @@ -258,11 +258,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059975 + 1314735810 @@ -675,6 +675,76 @@ + + + + BLOCK__OFFSET__INSIDE__FILE + + + BLOCK__OFFSET__INSIDE__FILE + + + true + + + src + + + + + bigint + + + + + + + INPUT__FILE__NAME + + + INPUT__FILE__NAME + + + true + + + src + + + + + + + + value + + + value + + + src + + + + + + + + key + + + key + + + src + + + + + + + + @@ -847,11 +917,7 @@ src - - - bigint - - + @@ -894,7 +960,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -906,7 +972,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -963,11 +1029,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059975 + 1314735810 @@ -1025,11 +1091,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059975 + 1314735810 @@ -1058,7 +1124,7 @@ 1 - pfile:/data/users/sdong/www/open-source-hive1/build/ql/scratchdir/hive_2011-04-28_23-52-57_564_8385471438034055340/-ext-10000 + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/scratchdir/hive_2011-08-30_13-23-31_510_1697498805648472139/-ext-10000 true @@ -1067,7 +1133,7 @@ 1 - pfile:/data/users/sdong/www/open-source-hive1/build/ql/scratchdir/hive_2011-04-28_23-52-57_564_8385471438034055340/-ext-10000/ + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/scratchdir/hive_2011-08-30_13-23-31_510_1697498805648472139/-ext-10000/ Index: ql/src/test/results/compiler/plan/groupby2.q.xml =================================================================== --- ql/src/test/results/compiler/plan/groupby2.q.xml (revision 1163362) +++ ql/src/test/results/compiler/plan/groupby2.q.xml (working copy) @@ -1,5 +1,5 @@ - + Stage-3 @@ -62,11 +62,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059983 + 1314735816 @@ -124,11 +124,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059983 + 1314735816 @@ -794,6 +794,72 @@ + + + + BLOCK__OFFSET__INSIDE__FILE + + + BLOCK__OFFSET__INSIDE__FILE + + + true + + + src + + + + + + + + INPUT__FILE__NAME + + + INPUT__FILE__NAME + + + true + + + src + + + + + + + + value + + + value + + + src + + + + + + + + key + + + key + + + src + + + + + + + + @@ -1006,7 +1072,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -1018,7 +1084,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -1075,11 +1141,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059983 + 1314735816 @@ -1137,11 +1203,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059983 + 1314735816 @@ -1167,13 +1233,13 @@ - file:/tmp/sdong/hive_2011-04-28_23-53-05_717_3597345881693191328/-ext-10001 + file:/tmp/charleschen/hive_2011-08-30_13-23-36_914_5938075765852205649/-ext-10001 1 - file:/tmp/sdong/hive_2011-04-28_23-53-05_717_3597345881693191328/-ext-10001/ + file:/tmp/charleschen/hive_2011-08-30_13-23-36_914_5938075765852205649/-ext-10001/ Index: ql/src/test/results/compiler/plan/groupby3.q.xml =================================================================== --- ql/src/test/results/compiler/plan/groupby3.q.xml (revision 1163362) +++ ql/src/test/results/compiler/plan/groupby3.q.xml (working copy) @@ -1,5 +1,5 @@ - + Stage-3 @@ -62,11 +62,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059992 + 1314735820 @@ -124,11 +124,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059992 + 1314735820 @@ -1012,6 +1012,72 @@ + + + + BLOCK__OFFSET__INSIDE__FILE + + + BLOCK__OFFSET__INSIDE__FILE + + + true + + + src + + + + + + + + INPUT__FILE__NAME + + + INPUT__FILE__NAME + + + true + + + src + + + + + + + + value + + + value + + + src + + + + + + + + key + + + key + + + src + + + + + + + + @@ -1202,7 +1268,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -1214,7 +1280,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -1271,11 +1337,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059992 + 1314735820 @@ -1333,11 +1399,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304059992 + 1314735820 @@ -1363,13 +1429,13 @@ - file:/tmp/sdong/hive_2011-04-28_23-53-14_115_4110241814083983918/-ext-10001 + file:/tmp/charleschen/hive_2011-08-30_13-23-41_528_3232121984739131523/-ext-10001 1 - file:/tmp/sdong/hive_2011-04-28_23-53-14_115_4110241814083983918/-ext-10001/ + file:/tmp/charleschen/hive_2011-08-30_13-23-41_528_3232121984739131523/-ext-10001/ Index: ql/src/test/results/compiler/plan/groupby4.q.xml =================================================================== --- ql/src/test/results/compiler/plan/groupby4.q.xml (revision 1163362) +++ ql/src/test/results/compiler/plan/groupby4.q.xml (working copy) @@ -1,5 +1,5 @@ - + Stage-3 @@ -62,11 +62,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060000 + 1314735825 @@ -124,11 +124,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060000 + 1314735825 @@ -470,6 +470,76 @@ + + + + BLOCK__OFFSET__INSIDE__FILE + + + BLOCK__OFFSET__INSIDE__FILE + + + true + + + src + + + + + bigint + + + + + + + INPUT__FILE__NAME + + + INPUT__FILE__NAME + + + true + + + src + + + + + + + + value + + + value + + + src + + + + + + + + key + + + key + + + src + + + + + + + + @@ -620,11 +690,7 @@ src - - - bigint - - + @@ -664,7 +730,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -676,7 +742,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -733,11 +799,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060000 + 1314735825 @@ -795,11 +861,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060000 + 1314735825 @@ -825,13 +891,13 @@ - file:/tmp/sdong/hive_2011-04-28_23-53-22_783_4211806616452121435/-ext-10001 + file:/tmp/charleschen/hive_2011-08-30_13-23-46_919_8273996101542787867/-ext-10001 1 - file:/tmp/sdong/hive_2011-04-28_23-53-22_783_4211806616452121435/-ext-10001/ + file:/tmp/charleschen/hive_2011-08-30_13-23-46_919_8273996101542787867/-ext-10001/ Index: ql/src/test/results/compiler/plan/groupby5.q.xml =================================================================== --- ql/src/test/results/compiler/plan/groupby5.q.xml (revision 1163362) +++ ql/src/test/results/compiler/plan/groupby5.q.xml (working copy) @@ -1,5 +1,5 @@ - + Stage-3 @@ -62,11 +62,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060009 + 1314735830 @@ -124,11 +124,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060009 + 1314735830 @@ -541,6 +541,76 @@ + + + + BLOCK__OFFSET__INSIDE__FILE + + + BLOCK__OFFSET__INSIDE__FILE + + + true + + + src + + + + + bigint + + + + + + + INPUT__FILE__NAME + + + INPUT__FILE__NAME + + + true + + + src + + + + + + + + value + + + value + + + src + + + + + + + + key + + + key + + + src + + + + + + + + @@ -713,11 +783,7 @@ src - - - bigint - - + @@ -757,7 +823,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -769,7 +835,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -826,11 +892,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060009 + 1314735830 @@ -888,11 +954,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060009 + 1314735830 @@ -918,13 +984,13 @@ - file:/tmp/sdong/hive_2011-04-28_23-53-31_497_7161274320844726028/-ext-10001 + file:/tmp/charleschen/hive_2011-08-30_13-23-51_258_269792457450539399/-ext-10001 1 - file:/tmp/sdong/hive_2011-04-28_23-53-31_497_7161274320844726028/-ext-10001/ + file:/tmp/charleschen/hive_2011-08-30_13-23-51_258_269792457450539399/-ext-10001/ Index: ql/src/test/results/compiler/plan/groupby6.q.xml =================================================================== --- ql/src/test/results/compiler/plan/groupby6.q.xml (revision 1163362) +++ ql/src/test/results/compiler/plan/groupby6.q.xml (working copy) @@ -1,5 +1,5 @@ - + Stage-3 @@ -62,11 +62,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060018 + 1314735836 @@ -124,11 +124,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060018 + 1314735836 @@ -470,6 +470,76 @@ + + + + BLOCK__OFFSET__INSIDE__FILE + + + BLOCK__OFFSET__INSIDE__FILE + + + true + + + src + + + + + bigint + + + + + + + INPUT__FILE__NAME + + + INPUT__FILE__NAME + + + true + + + src + + + + + + + + value + + + value + + + src + + + + + + + + key + + + key + + + src + + + + + + + + @@ -620,11 +690,7 @@ src - - - bigint - - + @@ -664,7 +730,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -676,7 +742,7 @@ - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src src @@ -733,11 +799,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060018 + 1314735836 @@ -795,11 +861,11 @@ location - pfile:/data/users/sdong/www/open-source-hive1/build/ql/test/data/warehouse/src + pfile:/data/users/charleschen/hivetests/ht08302011-131137/61/build/ql/test/data/warehouse/src transient_lastDdlTime - 1304060018 + 1314735836 @@ -825,13 +891,13 @@ - file:/tmp/sdong/hive_2011-04-28_23-53-40_990_4453382953456116593/-ext-10001 + file:/tmp/charleschen/hive_2011-08-30_13-23-57_488_5578607096887537542/-ext-10001 1 - file:/tmp/sdong/hive_2011-04-28_23-53-40_990_4453382953456116593/-ext-10001/ + file:/tmp/charleschen/hive_2011-08-30_13-23-57_488_5578607096887537542/-ext-10001/ Index: ql/src/test/queries/clientpositive/groupby_ppd.q =================================================================== --- ql/src/test/queries/clientpositive/groupby_ppd.q (revision 0) +++ ql/src/test/queries/clientpositive/groupby_ppd.q (revision 0) @@ -0,0 +1,4 @@ +-- see HIVE-2382 +create table invites (id int, foo int, bar int); +explain select * from (select foo, bar from (select bar, foo from invites c union all select bar, foo from invites d) b) a group by bar, foo having bar=1; +drop table invites; \ No newline at end of file Index: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (revision 1163362) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (working copy) @@ -5413,16 +5413,21 @@ ArrayList columns = inputRR.getColumnInfos(); ArrayList colList = new ArrayList(); ArrayList columnNames = new ArrayList(); + Map columnExprMap = + new HashMap(); for (int i = 0; i < columns.size(); i++) { ColumnInfo col = columns.get(i); colList.add(new ExprNodeColumnDesc(col.getType(), col.getInternalName(), col.getTabAlias(), col.getIsVirtualCol())); columnNames.add(col.getInternalName()); + columnExprMap.put(col.getInternalName(), + new ExprNodeColumnDesc(col.getType(), col.getInternalName(), + col.getTabAlias(), col.getIsVirtualCol())); } Operator output = putOpInsertMap(OperatorFactory.getAndMakeChild( new SelectDesc(colList, columnNames, true), new RowSchema(inputRR .getColumnInfos()), input), inputRR); - output.setColumnExprMap(input.getColumnExprMap()); + output.setColumnExprMap(columnExprMap); return output; }