-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-49498][SQL] Added test to check difference between SR_AI and SR_Latn_AI collations #47958
base: master
Are you sure you want to change the base?
Conversation
@@ -33,7 +35,7 @@ import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper | |||
import org.apache.spark.sql.execution.aggregate.{HashAggregateExec, ObjectHashAggregateExec} | |||
import org.apache.spark.sql.execution.columnar.InMemoryTableScanExec | |||
import org.apache.spark.sql.execution.joins._ | |||
import org.apache.spark.sql.internal.{SqlApiConf, SQLConf} | |||
import org.apache.spark.sql.internal.{SQLConf, SqlApiConf} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unneeded change
// scalastyle:off nonascii | ||
// SR_AI collation | ||
var collationName = "SR_AI" | ||
var builder = new ULocale.Builder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still test spark's and not directly the ICU behavior, even though we use ICU under the hood
builder.setUnicodeLocaleKeyword("kc", "true") | ||
collator = Collator.getInstance(builder.build()) | ||
|
||
assert(collator.compare("c", "ć") != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably put this inside a loop to avoid repetitive calls
Mind filing a JIRA please? See also https://spark.apache.org/contributing.html |
cffc0a3
to
ab0c6a5
Compare
@cloud-fan can you please review? |
("Z", "Ž") | ||
).foreach { | ||
case (c1, c2) => | ||
checkAnswer(sql(s"SELECT '$c1' = '$c2' COLLATE SR_Latn_AI"), Row(false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also check the result for sr_ai
here? It's more readable than comparing multiple characters at a time like you did above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
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.