diff --git a/backends-clickhouse/src/test/scala/io/glutenproject/execution/GlutenClickHouseTPCHParquetSuite.scala b/backends-clickhouse/src/test/scala/io/glutenproject/execution/GlutenClickHouseTPCHParquetSuite.scala index 4b041654a394..fe5a03adfe79 100644 --- a/backends-clickhouse/src/test/scala/io/glutenproject/execution/GlutenClickHouseTPCHParquetSuite.scala +++ b/backends-clickhouse/src/test/scala/io/glutenproject/execution/GlutenClickHouseTPCHParquetSuite.scala @@ -2070,6 +2070,16 @@ class GlutenClickHouseTPCHParquetSuite extends GlutenClickHouseTPCHAbstractSuite compareResultsAgainstVanillaSpark(sql, true, { _ => }) } + test("test in-filter contains null value (bigint)") { + val sql = "select s_nationkey from supplier where s_nationkey in (null, 1, 2)" + compareResultsAgainstVanillaSpark(sql, true, { _ => }) + } + + test("test in-filter contains null value (string)") { + val sql = "select n_name from nation where n_name in ('CANADA', null, 'BRAZIL')" + compareResultsAgainstVanillaSpark(sql, true, { _ => }) + } + test("GLUTEN-3287: diff when divide zero") { withSQLConf( SQLConf.OPTIMIZER_EXCLUDED_RULES.key -> (ConstantFolding.ruleName + "," + NullPropagation.ruleName)) { diff --git a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp index 680dcda6c0a9..5e8ebae4804a 100644 --- a/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp +++ b/cpp-ch/local-engine/Parser/SerializedPlanParser.cpp @@ -1839,6 +1839,7 @@ const ActionsDAG::Node * SerializedPlanParser::parseExpression(ActionsDAGPtr act DB::ActionsDAG::NodeRawConstPtrs cast_args({function_node, add_column(type, true), add_column(type, Field())}); auto cast = FunctionFactory::instance().get("if", context); function_node = toFunctionNode(actions_dag, "if", cast_args); + actions_dag->addOrReplaceInOutputs(*function_node); } return function_node; }