From 6f77eb1b8eb18b446ec3c67296fdfba33c08b3ef Mon Sep 17 00:00:00 2001 From: Daniel Hunte Date: Fri, 6 Dec 2024 15:46:56 -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 1d9abc128373..cbf32e984483 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 143cd18cfb0f..3e471321eba8 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,