kazuyukitanimura commented on code in PR #513:
URL: https://github.com/apache/datafusion-comet/pull/513#discussion_r1630419913
##########
core/src/execution/datafusion/expressions/scalar_funcs.rs:
##########
@@ -130,6 +133,10 @@ pub fn create_comet_physical_fun(
let func = Arc::new(spark_xxhash64);
make_comet_scalar_udf!("xxhash64", func, without data_type)
}
+ "chr" => {
Review Comment:
Is the expected behavior returning null if the input is null?
Another approach could be converting `chr(child)` to `If(IsNull(child),
literalNull, chr(child))` to reuse existing `chr`
##########
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala:
##########
@@ -980,6 +980,33 @@ 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,
+ SQLConf.ANSI_ENABLED.key -> "true",
+ CometConf.COMET_ANSI_MODE_ENABLED.key -> "true",
Review Comment:
Wondering if ANSI is related to this change...
--
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]