[
https://issues.apache.org/jira/browse/SPARK-47863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wenchen Fan resolved SPARK-47863.
---------------------------------
Fix Version/s: 4.0.0
Resolution: Fixed
Issue resolved by pull request 46097
[https://github.com/apache/spark/pull/46097]
> endsWith and startsWith don't work correctly for some collations
> ----------------------------------------------------------------
>
> Key: SPARK-47863
> URL: https://issues.apache.org/jira/browse/SPARK-47863
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Affects Versions: 4.0.0
> Reporter: Vladimir Golubev
> Assignee: Vladimir Golubev
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.0.0
>
>
> *CollationSupport.EndsWIth* and *CollationSupport.StartsWith* use
> {*}CollationAwareUTF8String.matchAt{*}, which operates byte offsets to
> compare prefixes/suffixes. This is not correct, since sometimes string parts
> (suffix/prefix) of different lengths are actually equal in context of
> case-insensitive and lower-case collations.
> Example test cases that highlight the problem:
> {{{}- *assertContains("The İo", "i̇o", "UNICODE_CI", true);* for
> *CollationSupportSuite.*{}}}{{{}{*}testContains{*}.{}}}
> {{{}- *assertEndsWith("The İo", "i̇o", "UNICODE_CI", true);* for
> *CollationSupportSuite.*{}}}{{{}{*}testEndsWith{*}.{}}}
> {{The first passes, since it uses *StringSearch* directly, the second one
> does not.}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]