diff --git a/velox/exec/tests/AggregationRunnerTest.cpp b/velox/exec/tests/AggregationRunnerTest.cpp index 2718960907a8..f8b918b9c97d 100644 --- a/velox/exec/tests/AggregationRunnerTest.cpp +++ b/velox/exec/tests/AggregationRunnerTest.cpp @@ -40,6 +40,19 @@ DEFINE_string( "Path for plan nodes to be restored from disk. This will enable single run " "of the fuzzer with the on-disk persisted plan information."); +DEFINE_string( + presto_url, + "", + "Presto coordinator URI along with port. If set, we use Presto " + "source of truth. Otherwise, use DuckDB. Example: " + "--presto_url=http://127.0.0.1:8080"); + +DEFINE_uint32( + req_timeout_ms, + 3000, + "Timeout in milliseconds for HTTP requests made to reference DB, " + "such as Presto. Example: --req_timeout_ms=2000"); + static std::string checkAndReturnFilePath( const std::string_view& fileName, const std::string& flagName) { @@ -76,8 +89,8 @@ int main(int argc, char** argv) { facebook::velox::aggregate::prestosql::registerAllAggregateFunctions(); facebook::velox::functions::prestosql::registerAllScalarFunctions(); - auto duckQueryRunner = - std::make_unique(); + auto queryRunner = facebook::velox::exec::test::setupReferenceQueryRunner( + FLAGS_presto_url, "aggregation_fuzzer", FLAGS_req_timeout_ms); return exec::test::AggregationFuzzerRunner::runRepro( - FLAGS_plan_nodes_path, std::move(duckQueryRunner)); + FLAGS_plan_nodes_path, std::move(queryRunner)); }