You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2024/11/23 11:07:34 UTC
Re: [PR] [SPARK-49670][SQL] Enable trim collation for all passthrough expressions [spark]
MaxGekk commented on code in PR #48739:
URL: https://github.com/apache/spark/pull/48739#discussion_r1855172770
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationAwareUTF8String.java:
##########
@@ -1530,20 +1530,29 @@ public static UTF8String trimRight(
public static UTF8String[] splitSQL(final UTF8String input, final UTF8String delim,
final int limit, final int collationId) {
- if (CollationFactory.fetchCollation(collationId).isUtf8BinaryType) {
+ CollationFactory.Collation collation = CollationFactory.fetchCollation(collationId);
+ if(collation.isUtf8BinaryType && !collation.supportsSpaceTrimming){
Review Comment:
```suggestion
if (collation.isUtf8BinaryType && !collation.supportsSpaceTrimming){
```
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationSupport.java:
##########
@@ -37,13 +37,15 @@ public final class CollationSupport {
public static class StringSplitSQL {
public static UTF8String[] exec(final UTF8String s, UTF8String d, final int collationId) {
CollationFactory.Collation collation = CollationFactory.fetchCollation(collationId);
- if (collation.supportsSpaceTrimming) {
- d = CollationFactory.applyTrimmingPolicy(d, collationId);
+ if(collation.isUtf8BinaryType && !collation.supportsSpaceTrimming){
Review Comment:
```suggestion
if (collation.isUtf8BinaryType && !collation.supportsSpaceTrimming){
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org