Skip to content

Commit

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

Summary:

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

Reviewed By: kagamiori

Differential Revision: D66132514
  • Loading branch information
Daniel Hunte authored and facebook-github-bot committed Dec 4, 2024
1 parent b93b474 commit 5ed68b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions velox/exec/fuzzer/DuckQueryRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,11 @@ std::optional<std::string> DuckQueryRunner::toSql(

std::optional<std::string> DuckQueryRunner::toSql(
const std::shared_ptr<const core::NestedLoopJoinNode>& joinNode) {
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
3 changes: 3 additions & 0 deletions velox/exec/fuzzer/PrestoQueryRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,11 @@ std::optional<std::string> PrestoQueryRunner::toSql(

std::optional<std::string> PrestoQueryRunner::toSql(
const std::shared_ptr<const core::NestedLoopJoinNode>& joinNode) {
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 5ed68b4

Please sign in to comment.