You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/09/13 05:08:00 UTC

[jira] [Work logged] (HIVE-26534) GROUPING() function errors out due to case-sensitivity of function name

     [ https://issues.apache.org/jira/browse/HIVE-26534?focusedWorklogId=808106&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-808106 ]

ASF GitHub Bot logged work on HIVE-26534:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Sep/22 05:07
            Start Date: 13/Sep/22 05:07
    Worklog Time Spent: 10m 
      Work Description: soumyakanti3578 opened a new pull request, #3591:
URL: https://github.com/apache/hive/pull/3591

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   Using `equalsIgnoreCase` instead of `equals` to compare String.
   
   
   ### Why are the changes needed?
   Without this change `grouping` and `GROUPING` behaves differently.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   mvn test -Dtest=TestMiniLlapLocalCliDriver -Dtest.output.overwrite=true -Dqfile=grouping_upper_lower_case.q
   




Issue Time Tracking
-------------------

            Worklog Id:     (was: 808106)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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
>          Time Spent: 10m
>  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)