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

Unresolved having at the end of analysis when using with LCA with the having clause that can be resolved directly by its child Aggregate

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • SQL
    • None

    Description

      select sum(value1) as total_1, total_1
      from values(1, 'name', 100, 50) AS data(id, name, value1, value2)
      having total_1 > 0
      
      SparkException: [INTERNAL_ERROR] Found the unresolved operator: 'UnresolvedHaving (total_1#353L > cast(0 as bigint)) 

      To trigger the issue, the having condition need to be (can be resolved by) an attribute in the select.
      Without the LCA total_1, the query works fine.

      Attachments

        Activity

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

          People

            xyyu Xinyi Yu
            xyyu Xinyi Yu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment