Skip to content

Commit 91007d3

Browse files
remove async_cpu_executor
1 parent f27ed23 commit 91007d3

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

cpp/src/arrow/dataset/scanner.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,9 @@ Result<std::shared_ptr<Table>> AsyncScanner::ToTable() {
406406
}
407407

408408
Result<EnumeratedRecordBatchGenerator> AsyncScanner::ScanBatchesUnorderedAsync() {
409-
return ScanBatchesUnorderedAsync(this->async_cpu_executor(),
409+
return ScanBatchesUnorderedAsync(scan_options_->cpu_executor
410+
? scan_options_->cpu_executor
411+
: ::arrow::internal::GetCpuThreadPool(),
410412
/*sequence_fragments=*/false);
411413
}
412414

@@ -607,7 +609,9 @@ Result<std::shared_ptr<Table>> AsyncScanner::Head(int64_t num_rows) {
607609
}
608610

609611
Result<TaggedRecordBatchGenerator> AsyncScanner::ScanBatchesAsync() {
610-
return ScanBatchesAsync(this->async_cpu_executor());
612+
return ScanBatchesAsync(scan_options_->cpu_executor
613+
? scan_options_->cpu_executor
614+
: ::arrow::internal::GetCpuThreadPool());
611615
}
612616

613617
Result<TaggedRecordBatchGenerator> AsyncScanner::ScanBatchesAsync(
@@ -784,7 +788,9 @@ Future<int64_t> AsyncScanner::CountRowsAsync(Executor* executor) {
784788
}
785789

786790
Future<int64_t> AsyncScanner::CountRowsAsync() {
787-
return CountRowsAsync(this->async_cpu_executor());
791+
return CountRowsAsync(scan_options_->cpu_executor
792+
? scan_options_->cpu_executor
793+
: ::arrow::internal::GetCpuThreadPool());
788794
}
789795

790796
Result<int64_t> AsyncScanner::CountRows() {

cpp/src/arrow/dataset/scanner.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,6 @@ class ARROW_DS_EXPORT Scanner {
465465
TaggedRecordBatchIterator scan);
466466

467467
const std::shared_ptr<ScanOptions> scan_options_;
468-
469-
::arrow::internal::Executor* async_cpu_executor() const {
470-
return scan_options_->cpu_executor ? scan_options_->cpu_executor
471-
: ::arrow::internal::GetCpuThreadPool();
472-
}
473468
};
474469

475470
/// \brief ScannerBuilder is a factory class to construct a Scanner. It is used

0 commit comments

Comments
 (0)