Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.3.2
-
None
-
None
-
Patch
Description
Hi team,
When STREAMTABLE hint is used for JOINs, GROUPBY index fails to skip the hint to select the right column. Take following query for example, I wanted to group by 'user', but the '1' index in GROUPBY clause actually points to the hint '/*+ STREAMTABLE(xyz) */' other than the actual 'user' column. Hence Hive errors out complaining: "Expression not in GROUP BY key 'user'"
select
/*+ STREAMTABLE(xyz) */
user,
sum(score)
from
test.roster
group by 1
To make the query work, I need to manually skip the hint by using 'group by 2' instead of 'group by 1'.
(Note that the STREAMTABLE hint is dummy in the query since there is no JOIN. It's added just to reproduce the error.)
We have made a patch at our local branch and tested it's working fine. If you have seen similar issues, feel free to apply our patch to your branch. Next we will create a PR for the patch for review. Please advise if I missed anything.