Skip to content

Commit

Permalink
Resolve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Oct 26, 2023
1 parent e7ddd79 commit 843c575
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
22 changes: 11 additions & 11 deletions cpp/src/arrow/csv/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1112,18 +1112,18 @@ class AsyncThreadedTableReader
protected:
Future<std::shared_ptr<Buffer>> ProcessFirstBuffer() {
// First block
auto self = shared_from_this();
auto first_buffer_future = buffer_generator_();
return first_buffer_future.Then([self](const std::shared_ptr<Buffer>& first_buffer)
-> Result<std::shared_ptr<Buffer>> {
if (first_buffer == nullptr) {
return Status::Invalid("Empty CSV file");
}
std::shared_ptr<Buffer> first_buffer_processed;
RETURN_NOT_OK(self->ProcessHeader(first_buffer, &first_buffer_processed));
RETURN_NOT_OK(self->MakeColumnBuilders());
return first_buffer_processed;
});
return first_buffer_future.Then(
[self = shared_from_this()](const std::shared_ptr<Buffer>& first_buffer)
-> Result<std::shared_ptr<Buffer>> {
if (first_buffer == nullptr) {
return Status::Invalid("Empty CSV file");
}
std::shared_ptr<Buffer> first_buffer_processed;
RETURN_NOT_OK(self->ProcessHeader(first_buffer, &first_buffer_processed));
RETURN_NOT_OK(self->MakeColumnBuilders());
return first_buffer_processed;
});
}

Executor* cpu_executor_;
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/parquet/arrow/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1122,9 +1122,8 @@ class RowGroupGenerator {
} else {
auto ready = reader->parquet_reader()->WhenBuffered({row_group}, column_indices);
if (cpu_executor_) ready = cpu_executor_->TransferAlways(ready);
auto cpu_executor = cpu_executor_;
row_group_read =
ready.Then([cpu_executor, reader, row_group,
ready.Then([cpu_executor = cpu_executor_, reader, row_group,
column_indices = std::move(
column_indices)]() -> ::arrow::Future<RecordBatchGenerator> {
return ReadOneRowGroup(cpu_executor, reader, row_group, column_indices);
Expand Down

0 comments on commit 843c575

Please sign in to comment.