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 82b26bd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 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
17 changes: 9 additions & 8 deletions velox/expression/tests/ExpressionFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}

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 82b26bd

Please sign in to comment.