uros-db commented on code in PR #45933: URL: https://github.com/apache/spark/pull/45933#discussion_r1565914458
########## sql/core/src/test/scala/org/apache/spark/sql/CollationStringExpressionsSuite.scala: ########## @@ -163,6 +163,78 @@ class CollationStringExpressionsSuite }) } + test("Ascii & UnBase64 expressions with collation") { Review Comment: ```suggestion test("Ascii & UnBase64 string expressions with collation") { ``` ########## sql/core/src/test/scala/org/apache/spark/sql/CollationStringExpressionsSuite.scala: ########## @@ -163,6 +163,78 @@ class CollationStringExpressionsSuite }) } + test("Ascii & UnBase64 expressions with collation") { + case class AsciiUnBase64TestCase[R](q: String, dt: DataType, r: R) + val testCases = Seq( + AsciiUnBase64TestCase("select ascii('a' collate utf8_binary)", IntegerType, Row(97)), + AsciiUnBase64TestCase("select ascii('a' collate utf8_binary_lcase)", IntegerType, Row(97)), + AsciiUnBase64TestCase("select unbase64('YQ==' collate utf8_binary)", BinaryType, + Row(Seq(97))), + AsciiUnBase64TestCase("select unbase64('YQ==' collate utf8_binary_lcase)", BinaryType, + Row(Seq(97))) + ) + testCases.foreach(t => { + // Result & data type + checkAnswer(sql(t.q), t.r) + assert(sql(t.q).schema.fields.head.dataType.sameType(t.dt)) + }) + } + + test("Chr, Base64, Decode & FormatNumber expressions with collation") { Review Comment: ```suggestion test("Chr, Base64, Decode & FormatNumber string expressions with collation") { ``` -- 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