srilman commented on code in PR #43698:
URL: https://github.com/apache/arrow/pull/43698#discussion_r1878750660
##########
cpp/src/arrow/dataset/file_parquet_test.cc:
##########
@@ -910,5 +911,53 @@ TEST_F(TestParquetFileFormat, MultithreadedScanRegression)
{
}
}
+TEST_F(TestParquetFileFormat, MultithreadedComputeRegression) {
+ // GH-43694: Test similar situation as MultithreadedScanRegression but with
+ // the exec context instead
+
+ auto reader = MakeGeneratedRecordBatch(schema({field("utf8", utf8())}),
10000, 100);
+ ASSERT_OK_AND_ASSIGN(auto buffer, ParquetFormatHelper::Write(reader.get()));
+
+ std::vector<Future<>> completes;
+ std::vector<std::shared_ptr<arrow::internal::ThreadPool>> pools;
+
+ for (int idx = 0; idx < 2; ++idx) {
+ auto buffer_reader = std::make_shared<DelayedBufferReader>(buffer);
+ auto source = std::make_shared<FileSource>(buffer_reader, buffer->size());
+ auto fragment = MakeFragment(*source);
+ std::shared_ptr<Scanner> scanner;
+
+ {
+ auto options = std::make_shared<ScanOptions>();
+ ASSERT_OK_AND_ASSIGN(auto thread_pool,
arrow::internal::ThreadPool::Make(1));
+ pools.emplace_back(thread_pool);
+ options->exec_context =
+ ::arrow::ExecContext(::arrow::default_memory_pool(),
pools.back().get());
Review Comment:
We don't need to ensure that `options->exec_context` is set because
initially the `ScanOptions` is constructed with the default `ExecContext`
constructor that uses the default `MemoryPool` and nullptr for the executor.
Thus, we need to check everywhere if the `exec_context->executor` is null and
use the default CPU pool if true.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]