@@ -2815,8 +2815,10 @@ DEBUG_ONLY_TEST_F(TableWriterArbitrationTest, reclaimFromTableWriter) {
28152815 const int numPrevArbitrationFailures = arbitrator->stats ().numFailures ;
28162816 const int numPrevNonReclaimableAttempts =
28172817 arbitrator->stats ().numNonReclaimableAttempts ;
2818- auto queryCtx = core::QueryCtx::create (
2819- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
2818+ auto queryCtx = core::QueryCtx::Builder ()
2819+ .executor (executor_.get ())
2820+ .pool (std::move (queryPool))
2821+ .build ();
28202822 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
28212823
28222824 std::atomic_int numInputs{0 };
@@ -2934,8 +2936,10 @@ DEBUG_ONLY_TEST_F(TableWriterArbitrationTest, reclaimFromSortTableWriter) {
29342936 const int numPrevArbitrationFailures = arbitrator->stats ().numFailures ;
29352937 const int numPrevNonReclaimableAttempts =
29362938 arbitrator->stats ().numNonReclaimableAttempts ;
2937- auto queryCtx = core::QueryCtx::create (
2938- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
2939+ auto queryCtx = core::QueryCtx::Builder ()
2940+ .executor (executor_.get ())
2941+ .pool (std::move (queryPool))
2942+ .build ();
29392943 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
29402944
29412945 const auto spillStats = common::globalSpillStats ();
@@ -3049,8 +3053,11 @@ DEBUG_ONLY_TEST_F(TableWriterArbitrationTest, writerFlushThreshold) {
30493053 const int numPrevArbitrationFailures = arbitrator->stats ().numFailures ;
30503054 const int numPrevNonReclaimableAttempts =
30513055 arbitrator->stats ().numNonReclaimableAttempts ;
3052- auto queryCtx = core::QueryCtx::create (
3053- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
3056+ auto queryCtx = core::QueryCtx::Builder ()
3057+ .executor (executor_.get ())
3058+ .pool (std::move (queryPool))
3059+ .build ();
3060+
30543061 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
30553062
30563063 memory::MemoryPool* compressionPool{nullptr };
@@ -3157,8 +3164,11 @@ DEBUG_ONLY_TEST_F(
31573164 const int numPrevArbitrationFailures = arbitrator->stats ().numFailures ;
31583165 const int numPrevNonReclaimableAttempts =
31593166 arbitrator->stats ().numNonReclaimableAttempts ;
3160- auto queryCtx = core::QueryCtx::create (
3161- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
3167+ auto queryCtx = core::QueryCtx::Builder ()
3168+ .executor (executor_.get ())
3169+ .pool (std::move (queryPool))
3170+ .build ();
3171+
31623172 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
31633173
31643174 std::atomic<bool > injectFakeAllocationOnce{true };
@@ -3240,8 +3250,10 @@ DEBUG_ONLY_TEST_F(
32403250 const int numPrevNonReclaimableAttempts =
32413251 arbitrator->stats ().numNonReclaimableAttempts ;
32423252 const int numPrevReclaimedBytes = arbitrator->stats ().reclaimedUsedBytes ;
3243- auto queryCtx = core::QueryCtx::create (
3244- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
3253+ auto queryCtx = core::QueryCtx::Builder ()
3254+ .executor (executor_.get ())
3255+ .pool (std::move (queryPool))
3256+ .build ();
32453257 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
32463258
32473259 std::atomic<bool > writerNoMoreInput{false };
@@ -3340,8 +3352,10 @@ DEBUG_ONLY_TEST_F(
33403352 const int numPrevArbitrationFailures = arbitrator->stats ().numFailures ;
33413353 const int numPrevNonReclaimableAttempts =
33423354 arbitrator->stats ().numNonReclaimableAttempts ;
3343- auto queryCtx = core::QueryCtx::create (
3344- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
3355+ auto queryCtx = core::QueryCtx::Builder ()
3356+ .executor (executor_.get ())
3357+ .pool (std::move (queryPool))
3358+ .build ();
33453359 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
33463360
33473361 std::atomic<bool > injectFakeAllocationOnce{true };
@@ -3432,8 +3446,11 @@ DEBUG_ONLY_TEST_F(TableWriterArbitrationTest, tableFileWriteError) {
34323446
34333447 auto queryPool = memory::memoryManager ()->addRootPool (
34343448 " tableFileWriteError" , kQueryMemoryCapacity );
3435- auto queryCtx = core::QueryCtx::create (
3436- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
3449+ auto queryCtx = core::QueryCtx::Builder ()
3450+ .executor (executor_.get ())
3451+ .pool (std::move (queryPool))
3452+ .build ();
3453+
34373454 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
34383455
34393456 std::atomic_bool injectWriterErrorOnce{true };
@@ -3500,8 +3517,10 @@ DEBUG_ONLY_TEST_F(TableWriterArbitrationTest, tableWriteSpillUseMoreMemory) {
35003517
35013518 auto queryPool = memory::memoryManager ()->addRootPool (
35023519 " tableWriteSpillUseMoreMemory" , kQueryMemoryCapacity / 4 );
3503- auto queryCtx = core::QueryCtx::create (
3504- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
3520+ auto queryCtx = core::QueryCtx::Builder ()
3521+ .executor (executor_.get ())
3522+ .pool (std::move (queryPool))
3523+ .build ();
35053524 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity / 4 );
35063525
35073526 auto fakeLeafPool = queryCtx->pool ()->addLeafChild (
@@ -3587,14 +3606,18 @@ DEBUG_ONLY_TEST_F(TableWriterArbitrationTest, tableWriteReclaimOnClose) {
35873606
35883607 auto queryPool = memory::memoryManager ()->addRootPool (
35893608 " tableWriteSpillUseMoreMemory" , kQueryMemoryCapacity );
3590- auto queryCtx = core::QueryCtx::create (
3591- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
3609+ auto queryCtx = core::QueryCtx::Builder ()
3610+ .executor (executor_.get ())
3611+ .pool (std::move (queryPool))
3612+ .build ();
35923613 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
35933614
35943615 auto fakeQueryPool =
35953616 memory::memoryManager ()->addRootPool (" fake" , kQueryMemoryCapacity );
3596- auto fakeQueryCtx = core::QueryCtx::create (
3597- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (fakeQueryPool));
3617+ auto fakeQueryCtx = core::QueryCtx::Builder ()
3618+ .executor (executor_.get ())
3619+ .pool (std::move (fakeQueryPool))
3620+ .build ();
35983621 ASSERT_EQ (fakeQueryCtx->pool ()->capacity (), kQueryMemoryCapacity );
35993622
36003623 auto fakeLeafPool = fakeQueryCtx->pool ()->addLeafChild (
@@ -3680,8 +3703,10 @@ DEBUG_ONLY_TEST_F(
36803703 .data ;
36813704 auto queryPool = memory::memoryManager ()->addRootPool (
36823705 " tableWriteSpillUseMoreMemory" , kQueryMemoryCapacity );
3683- auto queryCtx = core::QueryCtx::create (
3684- executor_.get (), QueryConfig{{}}, {}, nullptr , std::move (queryPool));
3706+ auto queryCtx = core::QueryCtx::Builder ()
3707+ .executor (executor_.get ())
3708+ .pool (std::move (queryPool))
3709+ .build ();
36853710 ASSERT_EQ (queryCtx->pool ()->capacity (), kQueryMemoryCapacity );
36863711
36873712 std::atomic_bool writerCloseWaitFlag{true };
0 commit comments