You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "fenfeng9 (via GitHub)" <gi...@apache.org> on 2026/01/26 07:24:48 UTC
[PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
fenfeng9 opened a new pull request, #48982:
URL: https://github.com/apache/arrow/pull/48982
### Rationale for this change
`FileReader::ReadRowGroup(s)` previously returned `Status` and required callers to pass an `out` parameter.
### What changes are included in this PR?
Introduce `Result<std::shared_ptr<Table>>` returning APIs to allow clearer error propagation:
- Add new Result-returning `ReadRowGroup()` / `ReadRowGroups()` methods
- Deprecate the old Status/out-parameter overloads
- Update C++ callers and R/Python/GLib bindings to use the new API
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.
Status versions of FileReader::ReadRowGroup(s) have been deprecated.
```cpp
virtual ::arrow::Status ReadRowGroup(int i, const std::vector<int>& column_indices,
std::shared_ptr<::arrow::Table>* out);
virtual ::arrow::Status ReadRowGroup(int i, std::shared_ptr<::arrow::Table>* out);
virtual ::arrow::Status ReadRowGroups(const std::vector<int>& row_groups,
const std::vector<int>& column_indices,
std::shared_ptr<::arrow::Table>* out);
virtual ::arrow::Status ReadRowGroups(const std::vector<int>& row_groups,
std::shared_ptr<::arrow::Table>* out);
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #48982:
URL: https://github.com/apache/arrow/pull/48982
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "fenfeng9 (via GitHub)" <gi...@apache.org>.
fenfeng9 commented on PR #48982:
URL: https://github.com/apache/arrow/pull/48982#issuecomment-3798289798
@kou, the PR is ready for review.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "fenfeng9 (via GitHub)" <gi...@apache.org>.
fenfeng9 commented on code in PR #48982:
URL: https://github.com/apache/arrow/pull/48982#discussion_r2730605502
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -2453,10 +2453,10 @@ TEST(TestArrowReadWrite, ReadSingleRowGroup) {
std::shared_ptr<Table> r1, r2, r3, r4;
// Read everything
- ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1));
+ ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
Review Comment:
Updated: r1/r3/r4 use `ASSERT_OK_AND_ASSIGN(auto ...)`, and r2 stays since `RowGroupReader::ReadTable` is still Status+out.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on code in PR #48982:
URL: https://github.com/apache/arrow/pull/48982#discussion_r2729827808
##########
cpp/src/parquet/arrow/reader_writer_benchmark.cc:
##########
@@ -778,7 +778,7 @@ static void BM_ReadMultipleRowGroups(::benchmark::State& state) {
auto arrow_reader = std::move(*arrow_reader_result);
std::shared_ptr<Table> table;
- EXIT_NOT_OK(arrow_reader->ReadRowGroups(rgs, &table));
+ PARQUET_ASSIGN_OR_THROW(table, arrow_reader->ReadRowGroups(rgs));
Review Comment:
```suggestion
PARQUET_ASSIGN_OR_THROW(auto table, arrow_reader->ReadRowGroups(rgs));
```
Let's remove line 780
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -2453,10 +2453,10 @@ TEST(TestArrowReadWrite, ReadSingleRowGroup) {
std::shared_ptr<Table> r1, r2, r3, r4;
// Read everything
- ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1));
+ ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
Review Comment:
```suggestion
ASSERT_OK_AND_ASSIGN(auto r1, reader->ReadRowGroup(0));
```
We have the chance to remove line 2454
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -2453,10 +2453,10 @@ TEST(TestArrowReadWrite, ReadSingleRowGroup) {
std::shared_ptr<Table> r1, r2, r3, r4;
// Read everything
- ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1));
+ ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
ASSERT_OK_NO_THROW(reader->RowGroup(1)->ReadTable(&r2));
Review Comment:
Do we have a Result version for this ReadTable call?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #48982:
URL: https://github.com/apache/arrow/pull/48982#issuecomment-3798210514
:warning: GitHub issue #48949 **has been automatically assigned in GitHub** to PR creator.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #48982:
URL: https://github.com/apache/arrow/pull/48982#discussion_r2730996531
##########
cpp/src/parquet/arrow/fuzz_internal.cc:
##########
@@ -98,16 +98,15 @@ namespace {
Status FuzzReadData(std::unique_ptr<FileReader> reader) {
auto final_status = Status::OK();
for (int i = 0; i < reader->num_row_groups(); ++i) {
- std::shared_ptr<Table> table;
- auto row_group_status = reader->ReadRowGroup(i, &table);
- if (row_group_status.ok()) {
+ auto table_result = reader->ReadRowGroup(i);
+ if (table_result.ok()) {
// When reading returns successfully, the Arrow data should be structurally
// valid so that it can be read normally. If that is not the case, abort
// so that the error can be published by OSS-Fuzz.
- ARROW_CHECK_OK(table->Validate());
- row_group_status &= table->ValidateFull();
+ ARROW_CHECK_OK((*table_result)->Validate());
+ final_status &= (*table_result)->ValidateFull();
Review Comment:
Let's assign `*table_result`:
```suggestion
auto table = *table_result;
ARROW_CHECK_OK(table->Validate());
final_status &= table->ValidateFull();
```
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -2453,10 +2453,10 @@ TEST(TestArrowReadWrite, ReadSingleRowGroup) {
std::shared_ptr<Table> r1, r2, r3, r4;
// Read everything
- ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1));
+ ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
ASSERT_OK_NO_THROW(reader->RowGroup(1)->ReadTable(&r2));
Review Comment:
Let's work on it as a separated task.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #48982:
URL: https://github.com/apache/arrow/pull/48982#issuecomment-3807086646
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit eb1525e25a8fe9ca6a2d55b55a0fa800b0abf1c7.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/61647596791) has more details.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "fenfeng9 (via GitHub)" <gi...@apache.org>.
fenfeng9 commented on code in PR #48982:
URL: https://github.com/apache/arrow/pull/48982#discussion_r2730589474
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -2453,10 +2453,10 @@ TEST(TestArrowReadWrite, ReadSingleRowGroup) {
std::shared_ptr<Table> r1, r2, r3, r4;
// Read everything
- ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1));
+ ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
ASSERT_OK_NO_THROW(reader->RowGroup(1)->ReadTable(&r2));
Review Comment:
This call is on a `RowGroupReader`, which still only has the Status + out-parameter API, so I left it unchanged.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) [arrow]
Posted by "fenfeng9 (via GitHub)" <gi...@apache.org>.
fenfeng9 commented on PR #48982:
URL: https://github.com/apache/arrow/pull/48982#issuecomment-3804668153
I’ve opened a follow‑up issue for RowGroupReader Result APIs: #49025.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org