From 82b26bd5d14fe2b82f7aef03952b08be8364df9a Mon Sep 17 00:00:00 2001 From: rui-mo Date: Thu, 28 Mar 2024 10:30:53 +0800 Subject: [PATCH] Fix --- velox/expression/ConstantExpr.cpp | 1 + velox/expression/tests/ExpressionFuzzer.cpp | 17 +++++++++-------- .../tests/utils/ArgumentTypeFuzzer.cpp | 10 ---------- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/velox/expression/ConstantExpr.cpp b/velox/expression/ConstantExpr.cpp index 28c43048be338..381d93741e45e 100644 --- a/velox/expression/ConstantExpr.cpp +++ b/velox/expression/ConstantExpr.cpp @@ -162,6 +162,7 @@ void appendSqlLiteral( case TypeKind::TINYINT: case TypeKind::SMALLINT: case TypeKind::BIGINT: + case TypeKind::HUGEINT: case TypeKind::TIMESTAMP: case TypeKind::REAL: case TypeKind::DOUBLE: diff --git a/velox/expression/tests/ExpressionFuzzer.cpp b/velox/expression/tests/ExpressionFuzzer.cpp index 94306c0c76d86..b5dc1518338a4 100644 --- a/velox/expression/tests/ExpressionFuzzer.cpp +++ b/velox/expression/tests/ExpressionFuzzer.cpp @@ -447,18 +447,19 @@ bool isSupportedSignature( const exec::FunctionSignature& signature, bool enableComplexType, bool enableDecimalType) { - // When enableDecimalType is disabled, not supporting decimal functions. - const bool useDecimal = - (useTypeName(signature, "long_decimal") || - useTypeName(signature, "short_decimal") || - useTypeName(signature, "decimal")); - // Not supporting lambda functions, or functions using timestamp with time - // zone types. + // When enableComplexType is disabled, not supporting complex functions. + const bool useComplexType = + (useTypeName(signature, "array") || useTypeName(signature, "map") || + useTypeName(signature, "row")); + // When enableDecimalType is disabled, not supporting decimal functions. Not + // supporting lambda functions, or functions using timestamp with time zone + // types. return !( useTypeName(signature, "opaque") || useTypeName(signature, "timestamp with time zone") || useTypeName(signature, "interval day to second") || - (!enableDecimalType && useDecimal) || + (!enableDecimalType && useTypeName(signature, "decimal")) || + (!enableComplexType && useComplexType) || (enableComplexType && useTypeName(signature, "unknown"))); } diff --git a/velox/expression/tests/utils/ArgumentTypeFuzzer.cpp b/velox/expression/tests/utils/ArgumentTypeFuzzer.cpp index 838c5ab50f760..4eb9ce3449059 100644 --- a/velox/expression/tests/utils/ArgumentTypeFuzzer.cpp +++ b/velox/expression/tests/utils/ArgumentTypeFuzzer.cpp @@ -47,16 +47,6 @@ void ArgumentTypeFuzzer::determineUnboundedIntegerVariables() { continue; } - // When variable name is 'precision' and result type is decimal, input type - // is regarded the same with the result type. - if (variableName == "precision" && returnType_ && - returnType_->isDecimal()) { - const auto [precision, scale] = getDecimalPrecisionScale(*returnType_); - integerVariablesBindings_["precision"] = precision; - integerVariablesBindings_["scale"] = scale; - continue; - } - // When decimal function is registered as vector function, the variable name // contains 'precision' like 'a_precision'. if (auto pos = variableName.find("precision"); pos != std::string::npos) {