This is an automated email from the ASF dual-hosted git repository.
philo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new ac227ded5 [VL] Remove the registry for Velox's prestosql scalar
functions (#5202)
ac227ded5 is described below
commit ac227ded59b5e1b7913bcd137bd46b52c7532303
Author: PHILO-HE <[email protected]>
AuthorDate: Thu Jun 27 09:16:17 2024 +0800
[VL] Remove the registry for Velox's prestosql scalar functions (#5202)
---
.../operators/functions/RegistrationAllFunctions.cc | 16 ++++++++++------
cpp/velox/substrait/SubstraitParser.cc | 12 +-----------
2 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/cpp/velox/operators/functions/RegistrationAllFunctions.cc
b/cpp/velox/operators/functions/RegistrationAllFunctions.cc
index b827690d1..638dbcccf 100644
--- a/cpp/velox/operators/functions/RegistrationAllFunctions.cc
+++ b/cpp/velox/operators/functions/RegistrationAllFunctions.cc
@@ -26,7 +26,6 @@
#include "velox/functions/prestosql/aggregates/RegisterAggregateFunctions.h"
#include "velox/functions/prestosql/registration/RegistrationFunctions.h"
#include "velox/functions/prestosql/window/WindowFunctionsRegistration.h"
-#include "velox/functions/sparksql/Bitwise.h"
#include "velox/functions/sparksql/Hash.h"
#include "velox/functions/sparksql/Rand.h"
#include "velox/functions/sparksql/Register.h"
@@ -35,6 +34,14 @@
using namespace facebook;
+namespace facebook::velox::functions {
+void registerPrestoVectorFunctions() {
+ // Presto function. To be removed.
+ VELOX_REGISTER_VECTOR_FUNCTION(udf_arrays_overlap, "arrays_overlap");
+ VELOX_REGISTER_VECTOR_FUNCTION(udf_transform_keys, "transform_keys");
+ VELOX_REGISTER_VECTOR_FUNCTION(udf_transform_values, "transform_values");
+}
+} // namespace facebook::velox::functions
namespace gluten {
namespace {
void registerFunctionOverwrite() {
@@ -67,19 +74,16 @@ void registerFunctionOverwrite() {
velox::exec::registerFunctionCallToSpecialForm(
kRowConstructorWithAllNull,
std::make_unique<RowConstructorWithNullCallToSpecialForm>(kRowConstructorWithAllNull));
- velox::functions::sparksql::registerBitwiseFunctions("spark_");
velox::functions::registerBinaryIntegral<velox::functions::CheckedPlusFunction>({"check_add"});
velox::functions::registerBinaryIntegral<velox::functions::CheckedMinusFunction>({"check_subtract"});
velox::functions::registerBinaryIntegral<velox::functions::CheckedMultiplyFunction>({"check_multiply"});
velox::functions::registerBinaryIntegral<velox::functions::CheckedDivideFunction>({"check_divide"});
+
+ velox::functions::registerPrestoVectorFunctions();
}
} // namespace
void registerAllFunctions() {
- // The registration order matters. Spark sql functions are registered after
- // presto sql functions to overwrite the registration for same named
- // functions.
- velox::functions::prestosql::registerAllScalarFunctions();
velox::functions::sparksql::registerFunctions("");
velox::aggregate::prestosql::registerAllAggregateFunctions(
"", true /*registerCompanionFunctions*/, false /*onlyPrestoSignatures*/,
true /*overwrite*/);
diff --git a/cpp/velox/substrait/SubstraitParser.cc
b/cpp/velox/substrait/SubstraitParser.cc
index 5555ecfef..b842914ca 100644
--- a/cpp/velox/substrait/SubstraitParser.cc
+++ b/cpp/velox/substrait/SubstraitParser.cc
@@ -391,23 +391,13 @@ std::unordered_map<std::string, std::string>
SubstraitParser::substraitVeloxFunc
{"named_struct", "row_constructor"},
{"bit_or", "bitwise_or_agg"},
{"bit_and", "bitwise_and_agg"},
- {"bitwise_and", "spark_bitwise_and"},
- {"bitwise_not", "spark_bitwise_not"},
- {"bitwise_or", "spark_bitwise_or"},
- {"bitwise_xor", "spark_bitwise_xor"},
- // TODO: the below registry for rand functions can be removed
- // after presto function registry is removed.
- {"rand", "spark_rand"},
{"murmur3hash", "hash_with_seed"},
{"xxhash64", "xxhash64_with_seed"},
{"modulus", "remainder"},
{"date_format", "format_datetime"},
{"collect_set", "set_agg"},
- {"forall", "all_match"},
- {"exists", "any_match"},
{"negative", "unaryminus"},
- {"get_array_item", "get"},
- {"arrays_zip", "zip"}};
+ {"get_array_item", "get"}};
const std::unordered_map<std::string, std::string> SubstraitParser::typeMap_ =
{
{"bool", "BOOLEAN"},
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]