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

ASF GitHub Bot updated SPARK-52545:
-----------------------------------
    Labels: pull-request-available  (was: )

> Handle `""` as `"` in double quoted literal
> -------------------------------------------
>
>                 Key: SPARK-52545
>                 URL: https://issues.apache.org/jira/browse/SPARK-52545
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 4.0.0
>            Reporter: Deng Ziming
>            Priority: Major
>              Labels: pull-request-available
>
>  
> spark.sql("""SELECT " ""aa"" " AS f1, " \"aa\" " AS f2, '""aa""' as 
> f3""".stripMargin).show() 
> +----+------+------+
> |  f1|    f2|    f3|
> +----+------+------+
> | aa | "aa" |""aa""|
> +----+------+------+
>  
> Below is the parse tree for ```SELECT " ""aa"" " AS f_1, " \"aa\" " AS f_2``` 
> before change, the difference between them is weird, quote-quote should be 
> treated as escaped quote.
> !https://bytedance.larkoffice.com/space/api/box/stream/download/asynccode/?code=NDczYWY0MjRmZWE1YTg0OTgxMDdiNDYwMzUxNzY2NzhfNzRCRnFJU1hia3IwaldZUk5USlY1TzB0R0N3NTBOV1BfVG9rZW46TVVHemJmSm4zb1hMTHB4d0d5WmMxdkg1bndXXzE3NTA1OTYyOTk6MTc1MDU5OTg5OV9WNA!
>  
> After this change, the parse tree was changed, and the result became 
> consistent with other databases such as MySQL.
> spark.sql("""SELECT " ""aa"" " AS f1, " \"aa\" " AS f2, '""aa""' as 
> f3""".stripMargin).show()
> +------+------+------+
> |    f1|    f2|    f3|
> +------+------+------+
> | "aa" | "aa" |""aa""|
> +------+------+------+
>  
> Mysql: 
> https://www.atlassian.com/data/sql/single-double-quote-and-backticks-in-mysql-queries



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