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

References in grouping functions should be indexed with resolver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0, 2.1.1, 2.2.0
    • 2.2.1, 2.3.0
    • SQL
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: