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

Fix Aggregate bug in RewriteWithExpression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.0
    • 4.0.0
    • SQL

    Description

      The following query will fail:

      SELECT NULLIF(id + 1, 1)
      from range(10)
      group by id
      

      This is because NullIf gets rewritten to With, then RewriteWithExpression tries to pull common expression id + 1 out of the aggregate, resulting in an invalid plan.

      Attachments

        Issue Links

          Activity

            People

              kelvinjiang Kelvin Jiang
              kelvinjiang Kelvin Jiang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: