Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo committed Mar 28, 2024
1 parent 7cf6820 commit 95add81
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions velox/expression/ConstantExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions velox/expression/tests/ExpressionFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,12 @@ bool isSupportedSignature(
const exec::FunctionSignature& signature,
bool enableComplexType,
bool enableDecimalType) {
// 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.
const bool useDecimal =
const bool useDecimalType =
(useTypeName(signature, "long_decimal") ||
useTypeName(signature, "short_decimal") ||
useTypeName(signature, "decimal"));
Expand All @@ -458,7 +462,8 @@ bool isSupportedSignature(
useTypeName(signature, "opaque") ||
useTypeName(signature, "timestamp with time zone") ||
useTypeName(signature, "interval day to second") ||
(!enableDecimalType && useDecimal) ||
(!enableDecimalType && useDecimalType) ||
(!enableComplexType && useComplexType) ||
(enableComplexType && useTypeName(signature, "unknown")));
}

Expand Down
10 changes: 0 additions & 10 deletions velox/expression/tests/utils/ArgumentTypeFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 95add81

Please sign in to comment.