Skip to content

Commit

Permalink
feat(fuzzer): Expand expression fuzzer skip list for fb functions (fa…
Browse files Browse the repository at this point in the history
…cebookincubator#12571)

Summary:

Add additional skip list for fb functions

Additionally, updates runner with typeArgGenerator and proper timezone that was affecting timezone function matching.

Reviewed By: kagamiori

Differential Revision: D70593746
  • Loading branch information
peterenescu authored and facebook-github-bot committed Mar 7, 2025
1 parent f52a5e9 commit 2fbfe11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion velox/exec/fuzzer/ToSQLUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ void toCallInputsSql(
// operators supported in Presto SQL.
const std::unordered_map<std::string, std::string>& unaryOperatorMap() {
static std::unordered_map<std::string, std::string> unaryOperatorMap{
{"negate", "-"}};
{"negate", "-"},
};
return unaryOperatorMap;
}

Expand All @@ -141,6 +142,7 @@ const std::unordered_map<std::string, std::string>& binaryOperatorMap() {
{"gt", ">"},
{"lte", "<="},
{"gte", ">="},
{"distinct_from", "is distinct from"},
};
return binaryOperatorMap;
}
Expand All @@ -163,6 +165,10 @@ std::string toCallSql(const core::CallTypedExprPtr& call) {
sql << fmt::format(" {} ", binaryOperators.at(call->name()));
toCallInputsSql({call->inputs()[1]}, sql);
sql << ")";
} else if (call->name() == "is_null" || call->name() == "not_null") {
VELOX_CHECK_EQ(call->inputs().size(), 1);
toCallInputsSql({call->inputs()[0]}, sql);
sql << fmt::format(" is{} null", call->name() == "not_null" ? " not" : "");
} else if (call->name() == "in") {
VELOX_CHECK_GE(call->inputs().size(), 2);
toCallInputsSql({call->inputs()[0]}, sql);
Expand Down
2 changes: 2 additions & 0 deletions velox/expression/tests/ExpressionVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ ExpressionVerifier::verify(
if (exceptionCommonPtr && exceptionReference) {
verificationStates.push_back(VerificationState::kBothPathsThrow);
} else {
verificationStates.push_back(
VerificationState::kReferencePathUnsupported);
if (!(defaultNull &&
referenceQueryRunner_->runnerType() ==
ReferenceQueryRunner::RunnerType::kPrestoQueryRunner)) {
Expand Down

0 comments on commit 2fbfe11

Please sign in to comment.