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

Fix data incorrect if aggregate function is empty

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.1, 3.3.0
    • 3.3.0, 3.2.2
    • SQL
    • None

    Description

      The group only condition should check if the aggregate expression is empty.

      In DataFrame api, it is allowed to make a empty aggregations.

      So the following query should return 1 rather than 0 because it's a global aggregate.

      val emptyAgg = Map.empty[String, String]
      spark.range(2).where("id > 2").agg(emptyAgg).limit(1).count
      

      Attachments

        Activity

          People

            ulysses XiDuo You
            ulysses XiDuo You
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: