From 5ee8dcb7d191591697677d9724c32fee0d51fffa Mon Sep 17 00:00:00 2001 From: Daniel Hunte Date: Mon, 9 Dec 2024 12:10:30 -0800 Subject: [PATCH] fix(fuzzer): Fix toSql methods for NestedLoopJoinNode in Reference Query Runners (#11576) Summary: The select clause is completely missing in the produced query string. Reviewed By: kagamiori Differential Revision: D66132514 --- velox/exec/fuzzer/DuckQueryRunner.cpp | 2 ++ velox/exec/fuzzer/PrestoQueryRunner.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/velox/exec/fuzzer/DuckQueryRunner.cpp b/velox/exec/fuzzer/DuckQueryRunner.cpp index 1d9abc128373a..cbf32e9844837 100644 --- a/velox/exec/fuzzer/DuckQueryRunner.cpp +++ b/velox/exec/fuzzer/DuckQueryRunner.cpp @@ -462,6 +462,8 @@ std::optional DuckQueryRunner::toSql( const auto& outputNames = joinNode->outputType()->names(); std::stringstream sql; + sql << "SELECT " << folly::join(", ", outputNames); + // Nested loop join without filter. VELOX_CHECK( joinNode->joinCondition() == nullptr, diff --git a/velox/exec/fuzzer/PrestoQueryRunner.cpp b/velox/exec/fuzzer/PrestoQueryRunner.cpp index 143cd18cfb0fb..3e471321eba84 100644 --- a/velox/exec/fuzzer/PrestoQueryRunner.cpp +++ b/velox/exec/fuzzer/PrestoQueryRunner.cpp @@ -676,6 +676,8 @@ std::optional PrestoQueryRunner::toSql( const auto& outputNames = joinNode->outputType()->names(); std::stringstream sql; + sql << "SELECT " << folly::join(", ", outputNames); + // Nested loop join without filter. VELOX_CHECK( joinNode->joinCondition() == nullptr,