You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Peter Toth (Jira)" <ji...@apache.org> on 2021/11/24 09:56:00 UTC

[jira] [Resolved] (SPARK-28299) Evaluation of multiple CTE uses

     [ https://issues.apache.org/jira/browse/SPARK-28299?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Toth resolved SPARK-28299.
--------------------------------
    Resolution: Duplicate

> Evaluation of multiple CTE uses  
> ---------------------------------
>
>                 Key: SPARK-28299
>                 URL: https://issues.apache.org/jira/browse/SPARK-28299
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.1.0
>            Reporter: Peter Toth
>            Priority: Major
>
> This query returns 2 in Spark SQL (ie. the CTE is evaluated twice), but it returns 1 in PostgreSQL.
> {noformat}
> WITH t(x) AS (SELECT random())
> SELECT count(*) FROM (
>   SELECT * FROM t
>   UNION
>   SELECT * FROM t
> ) x
> {noformat}
> I tested MSSQL too and it returns 2 as Spark SQL does. Further tests are needed on different DBs...



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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