[
https://issues.apache.org/jira/browse/SPARK-52545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18021460#comment-18021460
]
Aparna Garg commented on SPARK-52545:
-------------------------------------
User 'dengziming' has created a pull request for this issue:
https://github.com/apache/spark/pull/51379
> 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
> Assignee: Deng Ziming
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.1.0
>
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]