You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Soumyakanti Das (Jira)" <ji...@apache.org> on 2022/09/13 03:53:00 UTC
[jira] [Assigned] (HIVE-26534) GROUPING() function errors out due to case-sensitivity of function name
[ https://issues.apache.org/jira/browse/HIVE-26534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Soumyakanti Das reassigned HIVE-26534:
--------------------------------------
Assignee: Soumyakanti Das
> 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
>
> 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)