You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xinyi Yu (Jira)" <ji...@apache.org> on 2023/03/27 17:55:00 UTC

[jira] [Created] (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

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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org