Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-21980

References in grouping functions should be indexed with resolver

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0, 2.1.1, 2.2.0
    • Fix Version/s: 2.2.1, 2.3.0
    • Component/s: SQL
    • Labels:
      None

      Description

      In our spark-2.1 cluster, when users sumbit queries like

      select a, grouping(b), sum(c) from table group by a, b with cube
      

      It works well. However, when the query is

      select a, grouping(B), sum(c) from table group by a, b with cube
      

      We will get the exception:

      org.apache.spark.sql.AnalysisException: Column of grouping (B#11) can't be found in grouping columns a#10,b#11
      

      The root cause is the replaceGroupingFunc's incorrect logic in ResolveGroupingAnalytics
      rule. It indexes the column without resolver.

        Attachments

          Activity

            People

            • Assignee:
              donnyzone Feng Zhu
              Reporter:
              donnyzone Feng Zhu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: