diff --git a/cpp/src/arrow/engine/substrait/extension_set.cc b/cpp/src/arrow/engine/substrait/extension_set.cc index 50e9bd16335eb..70d9ef1acd0f8 100644 --- a/cpp/src/arrow/engine/substrait/extension_set.cc +++ b/cpp/src/arrow/engine/substrait/extension_set.cc @@ -358,15 +358,19 @@ ExtensionIdRegistry* default_extension_id_registry() { Status FunctionMapping::AddArrowToSubstrait(std::string arrow_function_name, ArrowToSubstrait conversion_func){ if (arrow_to_substrait.find(arrow_function_name) != arrow_to_substrait.end()){ arrow_to_substrait[arrow_function_name] = conversion_func; + return Status::OK(); + } else{ + return Status::Invalid("Arrow function already exist in the conversion map"); } - return Status::OK(); } Status FunctionMapping::AddSubstraitToArrow(std::string substrait_function_name, SubstraitToArrow conversion_func){ if (substrait_to_arrow.find(substrait_function_name) != substrait_to_arrow.end()){ substrait_to_arrow[substrait_function_name] = conversion_func; + return Status::OK(); + } else{ + return Status::Invalid("Substrait function already exist in the conversion map"); } - return Status::OK(); } Result FunctionMapping::GetArrowFromSubstrait(std::string name) const {