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

Vladimir Golubev updated SPARK-51113:
-------------------------------------
    Attachment: screenshot-2.png

> Correctness issue when reading a view with a trivial UNION/EXCEPT/INTERSECT 
> query
> ---------------------------------------------------------------------------------
>
>                 Key: SPARK-51113
>                 URL: https://issues.apache.org/jira/browse/SPARK-51113
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 4.0.0
>            Reporter: Vladimir Golubev
>            Priority: Critical
>         Attachments: screenshot-1.png, screenshot-2.png, screenshot-3.png
>
>
> There's a parser issue where for trivial UNION/EXCEPT/INTERSECT queries 
> inside views a keyword is considered an alias:
> ```
> spark.sql("CREATE OR REPLACE VIEW v1 AS SELECT 1 AS col1 UNION SELECT 2 UNION 
> SELECT 3 UNION SELECT 4")
> spark.sql("SELECT * FROM v1").show()
> spark.sql("SELECT * FROM v1").queryExecution.analyzed
> ```
>  !screenshot-1.png! 



--
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