Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The following errors out:
explain cbo select GROUPING(l_suppkey) from lineitem group by l_suppkey with rollup; Error: Error while compiling statement: FAILED: SemanticException [Error 10015]: Line 1:19 Arguments length mismatch 'l_suppkey': grouping() requires at least 2 argument, got 1 (state=21000,code=10015)
Lowercase grouping() succeeds:
explain cbo select grouping(l_suppkey) from lineitem group by l_suppkey with rollup; +----------------------------------------------------+ | Explain | +----------------------------------------------------+ | CBO PLAN: | | HiveProject(_o__c0=[grouping($1, 0:BIGINT)]) | | HiveAggregate(group=[{0}], groups=[[{0}, {}]], GROUPING__ID=[GROUPING__ID()]) | | HiveProject(l_suppkey=[$2]) | | HiveTableScan(table=[[tpch, lineitem]], table:alias=[lineitem]) | | | +----------------------------------------------------+
This is likely due to the SemanticAnalyzer doing a case-sensitive compare here:
@Override public Object post(Object t) { .... if (func.getText().equals("grouping") && func.getChildCount() == 0) {
We should fix this to make it case-insensitive comparison. There might be other places to examine too for grouping function.
Attachments
Issue Links
- links to