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

Fix construct aggregate expressions by replacing grouping functions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.3.3, 3.4.1, 3.5.0
    • SQL
    • None

    Description

      CREATE TEMPORARY VIEW grouping AS SELECT * FROM VALUES
        ("1", "2", "3", 1),
        ("4", "5", "6", 1),
        ("7", "8", "9", 1)
        as grouping(a, b, c, d);
      
      spark-sql (default)> SELECT CASE WHEN a IS NULL THEN count(b) WHEN b IS NULL THEN count(c) END
                         > FROM grouping
                         > GROUP BY GROUPING SETS (a, b, c);
      [MISSING_AGGREGATION] The non-aggregating expression "b" is based on columns which are not participating in the GROUP BY clause.
      

      Attachments

        Activity

          People

            yumwang Yuming Wang
            yumwang Yuming Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: