This is an automated email from the ASF dual-hosted git repository.
maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new f586ffbf47ee [SPARK-49498][SQL][TESTS] Check differences between SR_AI
and SR_Latn_AI collations
f586ffbf47ee is described below
commit f586ffbf47eec2b578ced1139ff13415a709a4d5
Author: Marko <[email protected]>
AuthorDate: Tue Sep 17 11:01:39 2024 +0200
[SPARK-49498][SQL][TESTS] Check differences between SR_AI and SR_Latn_AI
collations
### What changes were proposed in this pull request?
Added test to check difference between SR_AI and SR_Latn_AI collations.
### Why are the changes needed?
Better testing.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Test added to `CollationSuite.scala`
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #47958 from
ilicmarkodb/add_test_for_difference_between_SR_AI_and_SR_Latn_AI_collations.
Authored-by: Marko <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
---
.../org/apache/spark/sql/CollationSuite.scala | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/CollationSuite.scala
b/sql/core/src/test/scala/org/apache/spark/sql/CollationSuite.scala
index 489a990d3e1c..d5d18b1ab081 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/CollationSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/CollationSuite.scala
@@ -186,6 +186,29 @@ class CollationSuite extends DatasourceV2SQLBase with
AdaptiveSparkPlanHelper {
}
}
+ test("check difference betweeen SR_AI and SR_Latn_AI collations") {
+ // scalastyle:off nonascii
+ Seq(
+ ("c", "ć"),
+ ("c", "č"),
+ ("ć", "č"),
+ ("C", "Ć"),
+ ("C", "Č"),
+ ("Ć", "Č"),
+ ("s", "š"),
+ ("S", "Š"),
+ ("z", "ž"),
+ ("Z", "Ž")
+ ).foreach {
+ case (c1, c2) =>
+ // SR_Latn_AI
+ checkAnswer(sql(s"SELECT '$c1' = '$c2' COLLATE SR_Latn_AI"),
Row(false))
+ // SR_AI
+ checkAnswer(sql(s"SELECT '$c1' = '$c2' COLLATE SR_AI"), Row(true))
+ }
+ // scalastyle:on nonascii
+ }
+
test("equality check respects collation") {
Seq(
("utf8_binary", "aaa", "AAA", false),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]