From cc967f4ecec20140aea94a8efa8c95da0beb9d24 Mon Sep 17 00:00:00 2001 From: Masha Basmanova Date: Thu, 16 Nov 2023 11:18:00 -0800 Subject: [PATCH] Use RowTypePtr in QueryAssertions.* (#7607) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/7607 Reviewed By: xiaoxmeng Differential Revision: D51400887 Pulled By: mbasmanova fbshipit-source-id: 9eeb78b3f0f9737d8d4127eb0904ed231fd2e1bb --- velox/exec/tests/utils/QueryAssertions.cpp | 8 ++++---- velox/exec/tests/utils/QueryAssertions.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/velox/exec/tests/utils/QueryAssertions.cpp b/velox/exec/tests/utils/QueryAssertions.cpp index 5de6f1eeb5b9..42704ad43c69 100644 --- a/velox/exec/tests/utils/QueryAssertions.cpp +++ b/velox/exec/tests/utils/QueryAssertions.cpp @@ -339,7 +339,7 @@ velox::variant arrayVariantAt( std::vector materialize( ::duckdb::DataChunk* dataChunk, - const std::shared_ptr& rowType) { + const RowTypePtr& rowType) { VELOX_CHECK_EQ( rowType->size(), dataChunk->GetTypes().size(), "Wrong number of columns"); @@ -880,7 +880,7 @@ DuckDBQueryResult DuckDbQueryRunner::execute(const std::string& sql) { void DuckDbQueryRunner::execute( const std::string& sql, - const std::shared_ptr& resultRowType, + const RowTypePtr& resultRowType, std::function&)> resultCallback) { auto duckDbResult = execute(sql); @@ -1091,7 +1091,7 @@ bool assertEqualResults( void assertResults( const std::vector& results, - const std::shared_ptr& resultType, + const RowTypePtr& resultType, const std::string& duckDbSql, DuckDbQueryRunner& duckDbQueryRunner) { MaterializedRowMultiset actualRows; @@ -1179,7 +1179,7 @@ static bool compareOrderedPartitionsVectors( void assertResultsOrdered( const std::vector& results, - const std::shared_ptr& resultType, + const RowTypePtr& resultType, const std::string& duckDbSql, DuckDbQueryRunner& duckDbQueryRunner, const std::vector& sortingKeys) { diff --git a/velox/exec/tests/utils/QueryAssertions.h b/velox/exec/tests/utils/QueryAssertions.h index 77d24bfc9c55..d900b35c9e77 100644 --- a/velox/exec/tests/utils/QueryAssertions.h +++ b/velox/exec/tests/utils/QueryAssertions.h @@ -46,7 +46,7 @@ class DuckDbQueryRunner { MaterializedRowMultiset execute( const std::string& sql, - const std::shared_ptr& resultRowType) { + const RowTypePtr& resultRowType) { MaterializedRowMultiset allRows; execute( sql, @@ -60,7 +60,7 @@ class DuckDbQueryRunner { std::vector executeOrdered( const std::string& sql, - const std::shared_ptr& resultRowType) { + const RowTypePtr& resultRowType) { std::vector allRows; execute( sql, @@ -76,7 +76,7 @@ class DuckDbQueryRunner { void execute( const std::string& sql, - const std::shared_ptr& resultRowType, + const RowTypePtr& resultRowType, std::function&)> resultCallback); }; @@ -154,13 +154,13 @@ void assertEmptyResults(const std::vector& results); void assertResults( const std::vector& results, - const std::shared_ptr& resultType, + const RowTypePtr& resultType, const std::string& duckDbSql, DuckDbQueryRunner& duckDbQueryRunner); void assertResultsOrdered( const std::vector& results, - const std::shared_ptr& resultType, + const RowTypePtr& resultType, const std::string& duckDbSql, DuckDbQueryRunner& duckDbQueryRunner, const std::vector& sortingKeys);