GH-48394: [C++][Parquet] Add arrow::Result version of parquet::arrow::FileReader::ReadTable()#48939
Conversation
|
|
|
Hi @kou, Could you please review it? Thanks! |
| std::shared_ptr<arrow::Table> parquet_table; | ||
| // Read the table. | ||
| PARQUET_THROW_NOT_OK(reader->ReadTable(&parquet_table)); | ||
| PARQUET_ASSIGN_OR_THROW(auto parquet_table, reader->ReadTable()); |
There was a problem hiding this comment.
Could you keep using explicit type instead of auto for easy to understand?
| auto table_result = reader->ReadTable(column_indices); | ||
| ASSERT_OK(table_result.status()); |
There was a problem hiding this comment.
| auto table_result = reader->ReadTable(column_indices); | |
| ASSERT_OK(table_result.status()); | |
| ASSERT_OK_AND_ASSIGN(auto table, reader->ReadTable(column_indices)); |
If this reports the "variable is not used" warning, we can use ASSERT_OK(reader->ReadTable(column_indices).status());
| std::shared_ptr<Table> result; | ||
| ASSERT_OK(reader->ReadTable(column_subset, &result)); | ||
| ASSERT_OK_AND_ASSIGN(result, reader->ReadTable(column_subset)); |
There was a problem hiding this comment.
Could you use ASSERT_OK_AND_ASSIGN(auto result, reader->ReadTable(column_subset)); here?
| std::shared_ptr<Table> result; | ||
| ASSERT_OK_NO_THROW(reader->ReadTable(&result)); | ||
| ASSERT_OK_AND_ASSIGN(result, reader->ReadTable()); |
There was a problem hiding this comment.
Ditto. (There are more similar codes.)
| RETURN_NOT_OK(ReadRowGroups(Iota(reader_->metadata()->num_row_groups()), | ||
| column_indices, &table)); |
There was a problem hiding this comment.
Oh... We need to add arrow::Result version of ReadRowGroups()...
Let's work on it as a separated task. Could you open an issue for it?
There was a problem hiding this comment.
Sure, I'll open a new issue for the ReadRowGroups refactoring. I'll get to the code updates soon.
afe13a4 to
cf88ec1
Compare
|
I've created #48949 to track add |
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
|
Hi, @kou, I have a question: For R / Python / GLib bindings, can we switch directly to the new API? |
|
Yes. If you can't do it, I can help it. |
|
Thanks! I’ll try it first. |
cf88ec1 to
6ae9eb5
Compare
|
@kou CI passed, Please take a look when you get a chance. |
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 75ef031. There was 1 benchmark result with an error:
There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
FileReader::ReadTablepreviously returnedStatusand required callers to pass anoutparameter.What changes are included in this PR?
Introduce
Result<std::shared_ptr<Table>>returning API to allow clearer error propagation:ReadTable()methodsAre these changes tested?
Yes.
Are there any user-facing changes?
Yes.
Status version FileReader::ReadTable has been deprecated.
arrow::Resultversion ofparquet::arrow::FileReader::ReadTable()#48394