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

Hyukjin Kwon resolved SPARK-60574.
----------------------------------
    Fix Version/s: 4.4.0
       Resolution: Fixed

Issue resolved by pull request 59812
[https://github.com/apache/spark/pull/59812]

> Quote collated string literals in connector expressions
> -------------------------------------------------------
>
>                 Key: SPARK-60574
>                 URL: https://issues.apache.org/jira/browse/SPARK-60574
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 5.0.0, 4.4.0
>            Reporter: Linhong Liu
>            Assignee: Linhong Liu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.4.0
>
>
> The connector LiteralValue SQL renderer matches the StringType singleton 
> rather than all StringType instances. Non-default collations therefore miss 
> SQL quoting and single-quote escaping. For example, 
> LiteralValue(UTF8String.fromString("it's"), 
> StringType("UTF8_LCASE")).toString renders it's instead of 'it''s'.
> STARTS_WITH, ENDS_WITH and CONTAINS descriptions also assume that string 
> literals have surrounding quotes. An empty collated string can cause a 
> substring exception, and longer strings can lose their first and last 
> characters.
> Use a StringType type pattern to apply the existing quoting behavior to all 
> string types. Keep NULL rendering unchanged. Cover empty, short and quoted 
> strings, LIKE metacharacters, collations and constrained string types.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to