You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/06/24 06:33:00 UTC
[jira] [Updated] (SPARK-52545) Handle `""` as `"` in double quoted literal
[ 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org