uros-db commented on code in PR #46041:
URL: https://github.com/apache/spark/pull/46041#discussion_r1565541109


##########
sql/core/src/test/scala/org/apache/spark/sql/CollationStringExpressionsSuite.scala:
##########
@@ -163,6 +163,48 @@ class CollationStringExpressionsSuite
     })
   }
 
+  test("Support Lpad string expressions with collation") {
+    // Supported collations
+    case class PadTestCase[R](s: String, len: Int, pad: String, c: String, 
result: R)
+    val testCases = Seq(
+      PadTestCase("", 5, " ", "UTF8_BINARY", "     "),
+      PadTestCase("abc", 5, " ", "UNICODE", "  abc"),
+      PadTestCase("abc", 5, "XY", "UTF8_BINARY_LCASE", "XYabc"),
+      PadTestCase("abc", 5, "123", "UNICODE_CI", "12abc"),
+      PadTestCase("abc", 2, " ", "UTF8_BINARY", "ab"),
+      PadTestCase("abc", 2, "XY", "UNICODE", "ab"),
+      PadTestCase("abc", 2, "123", "UTF8_BINARY_LCASE", "ab"),
+      PadTestCase("abc", 2, "123", "UNICODE_CI", "ab")

Review Comment:
   since we're already using this compact subset of testcases (which is great), 
let's spice these up a bit
   
   mix in some case & accent variation, as well as variable byte-length 
characters here (but no need to add more test cases)



-- 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to