From 7185955f06830ff97779e8249ff97fe1353901ae Mon Sep 17 00:00:00 2001 From: Rui Mo Date: Mon, 6 Nov 2023 09:44:14 +0800 Subject: [PATCH] [VL] Align names of decimal compare functions (#3593) --- cpp/velox/substrait/SubstraitParser.cc | 11 +++++------ cpp/velox/substrait/SubstraitToVeloxPlan.cc | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cpp/velox/substrait/SubstraitParser.cc b/cpp/velox/substrait/SubstraitParser.cc index 2de7012f3bdc..b7e45b9f8b70 100644 --- a/cpp/velox/substrait/SubstraitParser.cc +++ b/cpp/velox/substrait/SubstraitParser.cc @@ -237,18 +237,17 @@ std::string SubstraitParser::findVeloxFunction( std::string SubstraitParser::mapToVeloxFunction(const std::string& substraitFunction, bool isDecimal) { auto it = substraitVeloxFunctionMap_.find(substraitFunction); if (isDecimal) { - if (substraitFunction == "round" || substraitFunction == "lt" || substraitFunction == "lte" || - substraitFunction == "gt" || substraitFunction == "gte") { - return "decimal_" + substraitFunction; + if (substraitFunction == "lt" || substraitFunction == "lte" || substraitFunction == "gt" || + substraitFunction == "gte" || substraitFunction == "equal") { + return "decimal_" + it->second; } - if (substraitFunction == "equal") { - return "decimal_eq"; + if (substraitFunction == "round") { + return "decimal_round"; } } if (it != substraitVeloxFunctionMap_.end()) { return it->second; } - // If not finding the mapping from Substrait function name to Velox function // name, the original Substrait function name will be used. return substraitFunction; diff --git a/cpp/velox/substrait/SubstraitToVeloxPlan.cc b/cpp/velox/substrait/SubstraitToVeloxPlan.cc index a0f5797e33e9..bc77d4531dc1 100644 --- a/cpp/velox/substrait/SubstraitToVeloxPlan.cc +++ b/cpp/velox/substrait/SubstraitToVeloxPlan.cc @@ -1116,7 +1116,7 @@ void SubstraitToVeloxPlanConverter::extractJoinKeys( if (funcName == "and") { expressions.push_back(&args[0].value()); expressions.push_back(&args[1].value()); - } else if (funcName == "eq" || funcName == "equalto" || funcName == "decimal_eq") { + } else if (funcName == "eq" || funcName == "equalto" || funcName == "decimal_equalto") { VELOX_CHECK(std::all_of(args.cbegin(), args.cend(), [](const ::substrait::FunctionArgument& arg) { return arg.value().has_selection(); }));