Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,9 @@ std::shared_ptr<core::QueryCtx> QueryContextManager::findOrCreateQueryCtx(
static std::atomic_uint64_t poolId{0};
auto pool = memory::MemoryManager::getInstance()->addRootPool(
fmt::format("{}_{}", queryId, poolId++),
queryConfig.queryMaxMemoryPerNode(),
!SystemConfig::instance()->memoryArbitratorKind().empty()
? memory::MemoryReclaimer::create()
: nullptr);
queryConfig.queryMaxMemoryPerNode());

auto queryCtx = std::make_shared<core::QueryCtx>(
auto queryCtx = core::QueryCtx::create(
driverExecutor_,
std::move(queryConfig),
connectorConfigs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BroadcastTest : public exec::test::OperatorTestBase {
const std::string& taskId,
core::PlanNodePtr planNode,
int destination) {
auto queryCtx = std::make_shared<core::QueryCtx>(executor_.get());
auto queryCtx = core::QueryCtx::create(executor_.get());
core::PlanFragment planFragment{planNode};
return exec::Task::create(
taskId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ class UnsafeRowShuffleTest : public exec::test::OperatorTestBase {
const std::string& taskId,
core::PlanNodePtr planNode,
int destination) {
auto queryCtx = std::make_shared<core::QueryCtx>(
executor_.get(), core::QueryConfig({}));
auto queryCtx =
core::QueryCtx::create(executor_.get(), core::QueryConfig({}));
core::PlanFragment planFragment{planNode};
return exec::Task::create(
taskId,
Expand Down Expand Up @@ -711,8 +711,8 @@ class UnsafeRowShuffleTest : public exec::test::OperatorTestBase {
{core::QueryConfig::kPreferredOutputBatchRows,
std::to_string(outputRowLimit)}};

auto queryCtx = std::make_shared<core::QueryCtx>(
executor_.get(), core::QueryConfig(properties));
auto queryCtx =
core::QueryCtx::create(executor_.get(), core::QueryConfig(properties));
auto params = exec::test::CursorParameters();
params.planNode = plan;
params.queryCtx = queryCtx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TEST_F(QueryContextCacheTest, basic) {

for (int i = 0; i < 16; ++i) {
auto queryId = fmt::format("query-{}", i);
auto queryCtx = std::make_shared<core::QueryCtx>(
auto queryCtx = core::QueryCtx::create(
(folly::Executor*)nullptr, core::QueryConfig({}));
queryCtxs[queryId] = queryCtx;
queryContextCache.insert(queryId, queryCtx);
Expand Down Expand Up @@ -84,7 +84,7 @@ TEST_F(QueryContextCacheTest, eviction) {

for (int i = 0; i < 8; ++i) {
auto queryId = fmt::format("query-{}", i);
auto queryCtx = std::make_shared<core::QueryCtx>(
auto queryCtx = core::QueryCtx::create(
(folly::Executor*)nullptr, core::QueryConfig({}));
queryCtxs[queryId] = queryCtx;
queryContextCache.insert(queryId, queryCtx);
Expand All @@ -104,7 +104,7 @@ TEST_F(QueryContextCacheTest, eviction) {
// Insert 4 more query ctxs
for (int i = 8; i < 12; ++i) {
auto queryId = fmt::format("query-{}", i);
auto queryCtx = std::make_shared<core::QueryCtx>(
auto queryCtx = core::QueryCtx::create(
(folly::Executor*)nullptr, core::QueryConfig({}));
queryCtxs[queryId] = queryCtx;
queryContextCache.insert(queryId, queryCtx);
Expand All @@ -118,7 +118,7 @@ TEST_F(QueryContextCacheTest, eviction) {
// Ensure that cache expands if all the queries in cache are alive.
for (int i = 12; i < 20; ++i) {
auto queryId = fmt::format("query-{}", i);
auto queryCtx = std::make_shared<core::QueryCtx>(
auto queryCtx = core::QueryCtx::create(
(folly::Executor*)nullptr, core::QueryConfig({}));
queryCtxs[queryId] = queryCtx;
queryContextCache.insert(queryId, queryCtx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ TEST_F(TaskManagerTest, testCumulativeMemory) {
.values(batches)
.partitionedOutput({}, 1)
.planFragment();
auto queryCtx = std::make_shared<core::QueryCtx>(driverExecutor_.get());
auto queryCtx = core::QueryCtx::create(driverExecutor_.get());
const protocol::TaskId taskId = "scan.0.0.1.0";
auto veloxTask = Task::create(
taskId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ std::shared_ptr<const core::PlanNode> assertToVeloxQueryPlan(
protocol::PlanFragment prestoPlan = json::parse(fragment);
auto pool = memory::deprecatedAddDefaultLeafMemoryPool();

auto queryCtx = std::make_shared<core::QueryCtx>();
auto queryCtx = core::QueryCtx::create();
VeloxInteractiveQueryPlanConverter converter(queryCtx.get(), pool.get());
return converter
.toVeloxQueryPlan(
Expand All @@ -80,7 +80,7 @@ std::shared_ptr<const core::PlanNode> assertToBatchVeloxQueryPlan(

protocol::PlanFragment prestoPlan = json::parse(fragment);
auto pool = memory::deprecatedAddDefaultLeafMemoryPool();
auto queryCtx = std::make_shared<core::QueryCtx>();
auto queryCtx = core::QueryCtx::create();
VeloxBatchQueryPlanConverter converter(
shuffleName,
std::move(serializedShuffleWriteInfo),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TEST_F(TestValues, valuesRowVector) {
testJsonRoundtrip(j, p);

auto pool = memory::deprecatedAddDefaultLeafMemoryPool();
auto queryCtx = std::make_shared<core::QueryCtx>();
auto queryCtx = core::QueryCtx::create();
VeloxInteractiveQueryPlanConverter converter(queryCtx.get(), pool.get());
auto values = std::dynamic_pointer_cast<const core::ValuesNode>(
converter.toVeloxQueryPlan(
Expand Down Expand Up @@ -103,7 +103,7 @@ TEST_F(TestValues, valuesPlan) {
testJsonRoundtrip(j, p);

auto pool = memory::deprecatedAddDefaultLeafMemoryPool();
auto queryCtx = std::make_shared<core::QueryCtx>();
auto queryCtx = core::QueryCtx::create();
VeloxInteractiveQueryPlanConverter converter(queryCtx.get(), pool.get());
auto values = converter.toVeloxQueryPlan(
std::dynamic_pointer_cast<protocol::OutputNode>(p->root)->source,
Expand Down
2 changes: 1 addition & 1 deletion presto-native-execution/velox
Submodule velox updated 75 files
+68 −43 velox/common/memory/Memory.cpp
+3 −4 velox/common/memory/Memory.h
+5 −0 velox/common/memory/MemoryPool.h
+3 −3 velox/common/memory/tests/MemoryCapExceededTest.cpp
+17 −1 velox/common/memory/tests/MemoryManagerTest.cpp
+129 −1 velox/common/memory/tests/SharedArbitratorTest.cpp
+11 −4 velox/connectors/hive/HiveConnectorUtil.cpp
+2 −3 velox/connectors/hive/HiveDataSink.cpp
+1 −0 velox/connectors/hive/HiveDataSink.h
+4 −4 velox/connectors/hive/tests/HiveConnectorTest.cpp
+137 −13 velox/core/QueryCtx.cpp
+95 −14 velox/core/QueryCtx.h
+1 −1 velox/core/tests/PlanFragmentTest.cpp
+6 −7 velox/core/tests/QueryConfigTest.cpp
+2 −2 velox/dwio/common/tests/utils/E2EFilterTestBase.cpp
+ velox/dwio/parquet/tests/examples/icebergNullIcebergPartition.parquet
+77 −13 velox/dwio/parquet/tests/reader/ParquetTableScanTest.cpp
+1 −1 velox/dwio/parquet/tests/writer/ParquetWriterTest.cpp
+1 −1 velox/examples/ExpressionEval.cpp
+1 −1 velox/examples/OpaqueType.cpp
+2 −2 velox/examples/ScanAndSort.cpp
+26 −2 velox/exec/Driver.cpp
+8 −0 velox/exec/Driver.h
+1 −1 velox/exec/ExchangeQueue.cpp
+41 −46 velox/exec/Unnest.cpp
+2 −1 velox/exec/Unnest.h
+1 −1 velox/exec/benchmarks/ExchangeBenchmark.cpp
+17 −17 velox/exec/tests/AggregationTest.cpp
+6 −9 velox/exec/tests/DriverTest.cpp
+1 −1 velox/exec/tests/ExchangeClientTest.cpp
+1 −1 velox/exec/tests/ExchangeFuzzer.cpp
+8 −8 velox/exec/tests/GroupedExecutionTest.cpp
+5 −5 velox/exec/tests/HashJoinTest.cpp
+1 −1 velox/exec/tests/MemoryReclaimerTest.cpp
+1 −1 velox/exec/tests/MergeJoinTest.cpp
+1 −1 velox/exec/tests/MergeTest.cpp
+1 −1 velox/exec/tests/MultiFragmentTest.cpp
+1 −1 velox/exec/tests/OperatorUtilsTest.cpp
+7 −7 velox/exec/tests/OrderByTest.cpp
+1 −1 velox/exec/tests/OutputBufferManagerTest.cpp
+1 −1 velox/exec/tests/PartitionedOutputTest.cpp
+3 −3 velox/exec/tests/RowNumberTest.cpp
+1 −1 velox/exec/tests/TableScanTest.cpp
+71 −81 velox/exec/tests/TableWriteTest.cpp
+28 −28 velox/exec/tests/TaskTest.cpp
+1 −1 velox/exec/tests/ThreadDebugInfoTest.cpp
+1 −1 velox/exec/tests/TopNRowNumberTest.cpp
+1 −1 velox/exec/tests/VeloxIn10MinDemo.cpp
+3 −5 velox/exec/tests/utils/ArbitratorTestUtil.cpp
+1 −1 velox/exec/tests/utils/AssertQueryBuilder.cpp
+1 −1 velox/exec/tests/utils/Cursor.cpp
+18 −12 velox/exec/tests/utils/HiveConnectorTestBase.cpp
+7 −2 velox/exec/tests/utils/HiveConnectorTestBase.h
+8 −3 velox/exec/tests/utils/PlanBuilder.cpp
+4 −1 velox/exec/tests/utils/PlanBuilder.h
+1 −1 velox/expression/fuzzer/ExpressionFuzzerVerifier.cpp
+1 −1 velox/expression/tests/ExprCompilerTest.cpp
+1 −1 velox/expression/tests/ExprEncodingsTest.cpp
+3 −3 velox/expression/tests/ExprTest.cpp
+2 −2 velox/expression/tests/ExprToSubfieldFilterTest.cpp
+1 −1 velox/expression/tests/ExpressionRunner.cpp
+2 −2 velox/expression/tests/ExpressionRunnerUnitTest.cpp
+2 −2 velox/expression/tests/ExpressionVerifierUnitTest.cpp
+2 −2 velox/functions/lib/aggregates/tests/utils/AggregationTestBase.cpp
+1 −1 velox/functions/lib/benchmarks/FunctionBenchmarkBase.h
+1 −1 velox/functions/prestosql/aggregates/benchmarks/ReduceAgg.cpp
+1 −1 velox/functions/prestosql/aggregates/benchmarks/SimpleAggregates.cpp
+1 −1 velox/functions/prestosql/aggregates/benchmarks/TwoStringKeys.cpp
+1 −1 velox/functions/prestosql/aggregates/tests/ApproxPercentileTest.cpp
+1 −1 velox/functions/prestosql/tests/SimpleComparisonMatcherTest.cpp
+1 −1 velox/functions/prestosql/tests/utils/FunctionBaseTest.h
+2 −2 velox/functions/remote/server/RemoteFunctionService.cpp
+1 −1 velox/functions/sparksql/tests/InputFileNameTest.cpp
+1 −2 velox/substrait/tests/FunctionTest.cpp
+1 −1 velox/vector/arrow/tests/ArrowBridgeArrayTest.cpp