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

Fix grouping sets with having clause can not resolve qualified col name

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 3.1.0
    • Fix Version/s: 2.4.8, 3.0.2, 3.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      Grouping sets construct new aggregate lost the qualified name of grouping expression. Here is a example:

      -- Works resolved by ResolveReferences
      select c1 from values (1) as t1(c1) group by grouping sets(t1.c1) having c1 = 1
      
      -- Works because of the extra expression c1
      select c1 as c2 from values (1) as t1(c1) group by grouping sets(t1.c1) having t1.c1 = 1
      
      -- Failed
      select c1 from values (1) as t1(c1) group by grouping sets(t1.c1) having t1.c1 = 1

        Attachments

          Activity

            People

            • Assignee:
              ulysses ulysses you
              Reporter:
              ulysses ulysses you
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: