Skip to content

Commit

Permalink
fix(fuzzer): Make PrestoQueryRunner fail when connection to server is…
Browse files Browse the repository at this point in the history
… unsuccessful (#12135)

Summary:
Pull Request resolved: #12135

This change throws an exception when the connection to the presto server is unsuccessful.

Reviewed By: kagamiori

Differential Revision: D68445811

fbshipit-source-id: 1b71f5f6d4eb983d3a04549a46b1579f4745b2eb
  • Loading branch information
Daniel Hunte authored and facebook-github-bot committed Jan 23, 2025
1 parent 97bb7a7 commit 1f190f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion velox/exec/fuzzer/PrestoQueryRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,11 @@ PrestoQueryRunner::executeAndReturnVector(const core::PlanNodePtr& plan) {

// Run the query.
return std::make_pair(execute(*sql), ReferenceQueryErrorCode::kSuccess);
} catch (...) {
} catch (const VeloxRuntimeError& e) {
// Throw if connection to Presto server is unsuccessful.
if (e.message().find("Couldn't connect to server") != std::string::npos) {
throw;
}
LOG(WARNING) << "Query failed in Presto";
return std::make_pair(
std::nullopt, ReferenceQueryErrorCode::kReferenceQueryFail);
Expand Down

0 comments on commit 1f190f4

Please sign in to comment.