Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-31085 Amend Spark's Semantic Versioning Policy
  3. SPARK-29701

Different answers when empty input given in GROUPING SETS

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Critical
    • Resolution: Won't Fix
    • 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 3.0.0
    • None
    • SQL

    Description

      A query below with an empty input seems to have different answers between PgSQL and Spark;

      postgres=# create table gstest_empty (a integer, b integer, v integer);
      CREATE TABLE
      postgres=# select a, b, sum(v), count(*) from gstest_empty group by grouping sets ((a,b),());
       a | b | sum | count 
      ---+---+-----+-------
         |   |     |     0
      (1 row)
      
      scala> sql("""select a, b, sum(v), count(*) from gstest_empty group by grouping sets ((a,b),())""").show
      +---+---+------+--------+
      |  a|  b|sum(v)|count(1)|
      +---+---+------+--------+
      +---+---+------+--------+
       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              maropu Takeshi Yamamuro
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: