[ https://issues.apache.org/jira/browse/HIVE-26534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17604875#comment-17604875 ]
Aman Sinha edited comment on HIVE-26534 at 9/14/22 5:49 PM: ------------------------------------------------------------ Marking this fixed since [~soumyakanti.das]'s PR has been merged. Thanks to the reviewers. was (Author: amansinha): Marking this fixed since [~soumyakanti.das] PR has been merged. > GROUPING() function errors out due to case-sensitivity of function name > ----------------------------------------------------------------------- > > Key: HIVE-26534 > URL: https://issues.apache.org/jira/browse/HIVE-26534 > Project: Hive > Issue Type: Bug > Components: Hive, Logical Optimizer > Reporter: Aman Sinha > Assignee: Soumyakanti Das > Priority: Major > Labels: pull-request-available > Time Spent: 1h > Remaining Estimate: 0h > > The following errors out: > {noformat} > 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) > {noformat} > Lowercase grouping() succeeds: > {noformat} > 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]) | > | | > +----------------------------------------------------+ > {noformat} > This is likely due to the SemanticAnalyzer doing a case-sensitive compare > here: > {noformat} > @Override > public Object post(Object t) { > .... > if (func.getText().equals("grouping") && func.getChildCount() == 0) > { > {noformat} > We should fix this to make it case-insensitive comparison. There might be > other places to examine too for grouping function. -- This message was sent by Atlassian Jira (v8.20.10#820010)