uros-db commented on code in PR #45856:
URL: https://github.com/apache/spark/pull/45856#discussion_r1552941872
##########
sql/core/src/test/scala/org/apache/spark/sql/CollationRegexpExpressionsSuite.scala:
##########
@@ -165,15 +165,23 @@ class CollationRegexpExpressionsSuite
// Supported collations
val checks = Seq(
- CollationTestCase("ABC", "[B]", "UTF8_BINARY", Seq("A", "C"))
+ CollationTestCase("ABC", "[B]", "UTF8_BINARY", Seq("A", "C")),
+ CollationTestCase("ABC", "[b]", "UTF8_BINARY", Seq("ABC")),
+ CollationTestCase("ABC", "[b]", "UTF8_BINARY_LCASE", Seq("A", "C")),
+ CollationTestCase("AAA", "[a]", "UTF8_BINARY_LCASE", Seq("", "", "",
"")),
+ CollationTestCase("AAA", "[b]", "UTF8_BINARY_LCASE", Seq("AAA")),
+ CollationTestCase("aAbB", "[ab]", "UTF8_BINARY_LCASE", Seq("", "", "",
"", "")),
+ CollationTestCase("", "", "UTF8_BINARY_LCASE", Seq("")),
+ CollationTestCase("", "[a]", "UTF8_BINARY_LCASE", Seq("")),
+ CollationTestCase("xAxBxaxbx", "[AB]", "UTF8_BINARY_LCASE", Seq("x",
"x", "x", "x", "x")),
+ CollationTestCase("ABC", "[B]", "UNICODE", Seq("A", "C")),
+ CollationTestCase("ABC", "[b]", "UNICODE", Seq("ABC"))
)
checks.foreach(ct =>
checkEvaluation(prepareStringSplit(ct.s1, ct.s2, ct.collation),
ct.expectedResult)
Review Comment:
I think we should consider rewriting `prepareStringSplit` here, as it
doesn't make much sense to do:
`val splitByExpr = Literal.create(splitBy, StringType(collationId))`
considering that **collationAwareSplit** doesn't respect collation for this
parameter at all
furthermore, consider how casting makes sense in this instance, and whether
it's needed at all
--
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]