Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
3.1.0
-
None
-
None
Description
This query returns 2 in Spark SQL (ie. the CTE is evaluated twice), but it returns 1 in PostgreSQL.
WITH t(x) AS (SELECT random()) SELECT count(*) FROM ( SELECT * FROM t UNION SELECT * FROM t ) x
I tested MSSQL too and it returns 2 as Spark SQL does. Further tests are needed on different DBs...
Attachments
Issue Links
- duplicates
-
SPARK-36447 Avoid inlining non-deterministic With-CTEs
- Resolved