Description
PostgreSQL handles nested WITHs in a different way then Spark does currently. These queries retunes 1 in Spark while they return 2 in PostgreSQL:
WITH t AS (SELECT 1), t2 AS ( WITH t AS (SELECT 2) SELECT * FROM t ) SELECT * FROM t2
WITH t AS (SELECT 1) SELECT ( WITH t AS (SELECT 2) SELECT * FROM t )