andygrove commented on code in PR #513:
URL: https://github.com/apache/datafusion-comet/pull/513#discussion_r1631485590


##########
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala:
##########
@@ -980,6 +980,29 @@ class CometExpressionSuite extends CometTestBase with 
AdaptiveSparkPlanHelper {
     }
   }
 
+  test("Chr with null character") {
+    // test compatibility with Spark, spark supports chr(0)
+    Seq(false, true).foreach { dictionary =>
+      withSQLConf(
+        "parquet.enable.dictionary" -> dictionary.toString,
+        CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.key -> "true") {
+        val table = "test0"
+        withTable(table) {
+          sql(s"create table $table(c9 int, c4 int) using parquet")
+          sql(s"insert into $table values(0, 0), (66, null), (null, 70), 
(null, null)")
+          val query = s"SELECT chr(c9), chr(c4) FROM $table"
+          checkSparkMaybeThrows(sql(query)) match {
+            case (None, None) => {}
+            case (Some(e), None) => throw e
+            case (None, Some(e)) => throw e
+            case (Some(e1), Some(e2)) => throw new Exception(s"$e1, $e2")
+          }

Review Comment:
   This seems redundant? You already call `checkSparkAnswerAndOperator` and we 
do not expect any exceptions to be thrown for the input values.



-- 
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: github-unsubscr...@datafusion.apache.org

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


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

Reply via email to