Skip to content

Commit

Permalink
fix(fuzzer) Fix toSql methods for NestedLoopJoinNode in Reference Que…
Browse files Browse the repository at this point in the history
…ry Runners (facebookincubator#11576)

Summary:

The select clause is completely missing in the produced query string.

Differential Revision: D66132514
  • Loading branch information
Daniel Hunte authored and facebook-github-bot committed Nov 18, 2024
1 parent 255ac02 commit e9a49bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
13 changes: 2 additions & 11 deletions velox/exec/fuzzer/DuckQueryRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,20 +428,11 @@ std::optional<std::string> DuckQueryRunner::toSql(

std::optional<std::string> DuckQueryRunner::toSql(
const std::shared_ptr<const core::NestedLoopJoinNode>& joinNode) {
const auto& joinKeysToSql = [](auto keys) {
std::stringstream out;
for (auto i = 0; i < keys.size(); ++i) {
if (i > 0) {
out << ", ";
}
out << keys[i]->name();
}
return out.str();
};

const auto& outputNames = joinNode->outputType()->names();
std::stringstream sql;

sql << "SELECT " << folly::join(", ", outputNames);

// Nested loop join without filter.
VELOX_CHECK(
joinNode->joinCondition() == nullptr,
Expand Down
13 changes: 2 additions & 11 deletions velox/exec/fuzzer/PrestoQueryRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,20 +643,11 @@ std::optional<std::string> PrestoQueryRunner::toSql(

std::optional<std::string> PrestoQueryRunner::toSql(
const std::shared_ptr<const core::NestedLoopJoinNode>& joinNode) {
const auto& joinKeysToSql = [](auto keys) {
std::stringstream out;
for (auto i = 0; i < keys.size(); ++i) {
if (i > 0) {
out << ", ";
}
out << keys[i]->name();
}
return out.str();
};

const auto& outputNames = joinNode->outputType()->names();
std::stringstream sql;

sql << "SELECT " << folly::join(", ", outputNames);

// Nested loop join without filter.
VELOX_CHECK(
joinNode->joinCondition() == nullptr,
Expand Down

0 comments on commit e9a49bf

Please sign in to comment.