diff --git a/velox/expression/FunctionSignature.h b/velox/expression/FunctionSignature.h index 0fb27f0b3df9..ca410a9a4aae 100644 --- a/velox/expression/FunctionSignature.h +++ b/velox/expression/FunctionSignature.h @@ -309,10 +309,6 @@ class FunctionSignatureBuilder { return *this; } - /// Variable arity arguments can appear - /// only at the end of the argument list and their types must match the type - /// specified in the last entry of 'argumentTypes'. Variable arity arguments - /// can appear zero or more times. FunctionSignatureBuilder& variableArity() { variableArity_ = true; return *this; diff --git a/velox/expression/tests/ExprCompilerTest.cpp b/velox/expression/tests/ExprCompilerTest.cpp index 083842d4ad40..e038c468e157 100644 --- a/velox/expression/tests/ExprCompilerTest.cpp +++ b/velox/expression/tests/ExprCompilerTest.cpp @@ -268,7 +268,9 @@ TEST_F(ExprCompilerTest, functionSignatureNotRegistered) { VELOX_ASSERT_THROW( compile(expression), - "Scalar function concat not registered with arguments: (BIGINT, BIGINT)"); + "Scalar function concat not registered with arguments: (BIGINT, BIGINT). " + "Found function registered with the following signatures:\n" + "((varchar,varchar...) -> varchar)"); } TEST_F(ExprCompilerTest, constantFromFlatVector) { diff --git a/velox/functions/prestosql/StringFunctions.cpp b/velox/functions/prestosql/StringFunctions.cpp index f34328e058fc..60d22e5e9a45 100644 --- a/velox/functions/prestosql/StringFunctions.cpp +++ b/velox/functions/prestosql/StringFunctions.cpp @@ -258,7 +258,6 @@ class ConcatFunction : public exec::VectorFunction { .returnType("varchar") .argumentType("varchar") .argumentType("varchar") - .argumentType("varchar") .variableArity() .build(), // varbinary, varbinary,.. -> varbinary @@ -266,7 +265,6 @@ class ConcatFunction : public exec::VectorFunction { .returnType("varbinary") .argumentType("varbinary") .argumentType("varbinary") - .argumentType("varbinary") .variableArity() .build(), }; diff --git a/velox/functions/prestosql/tests/StringFunctionsTest.cpp b/velox/functions/prestosql/tests/StringFunctionsTest.cpp index 06bc1160bba1..d884a25c2f56 100644 --- a/velox/functions/prestosql/tests/StringFunctionsTest.cpp +++ b/velox/functions/prestosql/tests/StringFunctionsTest.cpp @@ -844,7 +844,7 @@ TEST_F(StringFunctionsTest, concat) { size_t maxStringLength = 100; std::vector> inputTable; - for (int argsCount = 2; argsCount <= maxArgsCount; argsCount++) { + for (int argsCount = 1; argsCount <= maxArgsCount; argsCount++) { inputTable.clear(); // Create table with argsCount columns @@ -930,13 +930,6 @@ TEST_F(StringFunctionsTest, concat) { test::assertEqualVectors(expected, result); } - - // Less than 2 concatenation arguments throws exception. - { - VELOX_ASSERT_THROW( - evaluateOnce("concat('a')", {}), - "Scalar function signature is not supported: concat(VARCHAR)."); - } } TEST_F(StringFunctionsTest, concatVarbinary) {