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

Fix Aggregate bug in RewriteWithExpression

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment