stefankandic commented on code in PR #45436:
URL: https://github.com/apache/spark/pull/45436#discussion_r1519361380


##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationFactory.java:
##########
@@ -138,11 +138,13 @@ public Collation(
     collationTable[2] = new Collation(
       "UNICODE", Collator.getInstance(ULocale.ROOT), "153.120.0.0", true);
     collationTable[2].collator.setStrength(Collator.TERTIARY);
+    collationTable[2].collator.freeze();

Review Comment:
   @cloud-fan collator uses a buffer while writing collation keys, freezing it 
makes this operation safe by using a reentrant lock around it 
([source](https://github.com/unicode-org/icu/blob/main/icu4j/main/collate/src/main/java/com/ibm/icu/text/RuleBasedCollator.java#L1831))
   
   this of course raises performance issues which we should probably discuss, 
because now only one thread can generate sort keys



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to