Xinyi Yu created SPARK-42936:
--------------------------------

             Summary: Unresolved having at the end of analysis when using with 
LCA with the having clause that can be resolved directly by its child Aggregate
                 Key: SPARK-42936
                 URL: https://issues.apache.org/jira/browse/SPARK-42936
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.4.0
            Reporter: Xinyi Yu


{code:java}
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)) {code}
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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to