From e96930048b343099b2f46530fb187cf228a4750a Mon Sep 17 00:00:00 2001 From: "Ma, Rong" Date: Wed, 10 Jan 2024 11:30:23 +0800 Subject: [PATCH] Rename presto 'replace' function to 'presto_replace' to avoid confliction (workaround of 4922) --- .../prestosql/registration/StringFunctionsRegistration.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/velox/functions/prestosql/registration/StringFunctionsRegistration.cpp b/velox/functions/prestosql/registration/StringFunctionsRegistration.cpp index 0e68c07af04e..aa7c0343f8b5 100644 --- a/velox/functions/prestosql/registration/StringFunctionsRegistration.cpp +++ b/velox/functions/prestosql/registration/StringFunctionsRegistration.cpp @@ -104,7 +104,10 @@ void registerStringFunctions(const std::string& prefix) { Varchar, Varchar>({prefix + "split_to_map"}); VELOX_REGISTER_VECTOR_FUNCTION(udf_concat, prefix + "concat"); - VELOX_REGISTER_VECTOR_FUNCTION(udf_replace, prefix + "replace"); + // In Gluten, presto 'replace' function is conflict with sparksql, because + // presto 'replace' is registered as VectorFunction, and spark 'replace' is + // registered as SimpleFunction. Velox respect VectorFunction first. + VELOX_REGISTER_VECTOR_FUNCTION(udf_replace, prefix + "presto_replace"); VELOX_REGISTER_VECTOR_FUNCTION(udf_reverse, prefix + "reverse"); VELOX_REGISTER_VECTOR_FUNCTION(udf_to_utf8, prefix + "to_utf8"); VELOX_REGISTER_VECTOR_FUNCTION(udf_from_utf8, prefix + "from_utf8");