diff --git a/cpp-ch/local-engine/Parser/scalar_function_parser/floor.cpp b/cpp-ch/local-engine/Parser/scalar_function_parser/floor.cpp index bf397dfb90744..f99833243edae 100644 --- a/cpp-ch/local-engine/Parser/scalar_function_parser/floor.cpp +++ b/cpp-ch/local-engine/Parser/scalar_function_parser/floor.cpp @@ -61,7 +61,17 @@ class FunctionParserFloor : public FunctionParser throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Function {} requires exactly one arguments", getName()); const auto * first_arg = parsed_args[0]; - const auto * floor_node = toFunctionNode(actions_dag, "floor", {first_arg}); + const ActionsDAG::Node * floor_node; + if (parsed_args.size() == 1) + floor_node = toFunctionNode(actions_dag, "floor", {first_arg}); + else + { + const auto * second_arg = parsed_args[1]; + floor_node = toFunctionNode(actions_dag, "floor", {first_arg, second_arg}); + } + if (!isNativeNumber(removeNullable(first_arg->result_type))) + return convertNodeTypeIfNeeded(substrait_func, floor_node, actions_dag); + auto nullable_result_type = makeNullable(floor_node->result_type); const auto * null_const_node = addColumnToActionsDAG(actions_dag, nullable_result_type, Field()); const auto * is_nan_node = toFunctionNode(actions_dag, "isNaN", {first_arg});