andygrove commented on code in PR #2630:
URL: https://github.com/apache/datafusion-comet/pull/2630#discussion_r2457629264
##########
spark/src/test/scala/org/apache/comet/CometStringExpressionSuite.scala:
##########
@@ -19,12 +19,81 @@
package org.apache.comet
+import scala.util.Random
+
import org.apache.parquet.hadoop.ParquetOutputFormat
import org.apache.spark.sql.{CometTestBase, DataFrame}
import org.apache.spark.sql.internal.SQLConf
+import org.apache.spark.sql.types.{DataTypes, StructField, StructType}
+
+import org.apache.comet.testing.{DataGenOptions, FuzzDataGenerator}
class CometStringExpressionSuite extends CometTestBase {
+ test("lpad") {
+ testPadding("lpad")
+ }
+
+ test("rpad") {
+ testPadding("rpad")
+ }
+
+ private def testPadding(expr: String): Unit = {
+ val r = new Random(42)
+ val schema = StructType(
+ Seq(
+ StructField("str", DataTypes.StringType, nullable = true),
+ StructField("len", DataTypes.IntegerType, nullable = true),
+ StructField("pad", DataTypes.StringType, nullable = true)))
+ // scalastyle:off
+ val edgeCases = Seq(
+ "é", // unicode 'e\\u{301}'
+ "é", // unicode '\\u{e9}'
+ "తెలుగు")
Review Comment:
The first two were added in
https://github.com/apache/datafusion-comet/pull/772 to make sure Comet was
consistent with Spark even though Rust and Java have different ways of
representing unicode and graphemes.
--
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]