diff --git a/native/core/src/execution/datafusion/planner.rs b/native/core/src/execution/datafusion/planner.rs index a305774397..f2568cdc58 100644 --- a/native/core/src/execution/datafusion/planner.rs +++ b/native/core/src/execution/datafusion/planner.rs @@ -1855,7 +1855,7 @@ impl PhysicalPlanner { .into_iter() .zip(input_expr_types.into_iter().zip(coerced_input_types)) .map(|(expr, (from_type, to_type))| { - if !from_type.equals_datatype(&to_type) { + if from_type != to_type { Arc::new(CastExpr::new( expr, to_type, diff --git a/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala b/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala index 3701be5fb6..8ede317f97 100644 --- a/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala +++ b/spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala @@ -2085,13 +2085,12 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper { df.select(array(array(col("_4")), array(col("_4"), lit(null))))) checkSparkAnswerAndOperator(df.select(array(col("_8"), col("_13")))) // This ends up returning empty strings instead of nulls for the last element - // Fixed by https://github.com/apache/datafusion/commit/27304239ef79b50a443320791755bf74eed4a85d - // checkSparkAnswerAndOperator(df.select(array(col("_8"), col("_13"), lit(null)))) + checkSparkAnswerAndOperator(df.select(array(col("_8"), col("_13"), lit(null)))) checkSparkAnswerAndOperator(df.select(array(array(col("_8")), array(col("_13"))))) checkSparkAnswerAndOperator(df.select(array(col("_8"), col("_8"), lit(null)))) checkSparkAnswerAndOperator(df.select(array(struct("_4"), struct("_4")))) - // Fixed by https://github.com/apache/datafusion/commit/140f7cec78febd73d3db537a816badaaf567530a - // checkSparkAnswerAndOperator(df.select(array(struct(col("_8").alias("a")), struct(col("_13").alias("a"))))) + checkSparkAnswerAndOperator( + df.select(array(struct(col("_8").alias("a")), struct(col("_13").alias("a"))))) } } }