Skip to content

GH-46869: [C++][Parquet] Deprecate arrow::Status parquet::arrow::FileReadeder::GetRecordBatchReader() - #46932

Merged
kou merged 2 commits into
apache:mainfrom
Ziy1-Tan:main
Jul 4, 2025
Merged

GH-46869: [C++][Parquet] Deprecate arrow::Status parquet::arrow::FileReadeder::GetRecordBatchReader()#46932
kou merged 2 commits into
apache:mainfrom
Ziy1-Tan:main

Conversation

@Ziy1-Tan

@Ziy1-TanZiy1-Tan commented Jun 29, 2025

Copy link
Copy Markdown
Contributor

Rationale for this change

We're migrating arrow::Status + output variable API to arrow::Result API.

What changes are included in this PR?

  • Deprecate arrow::Status parquet::arrow::FileReadeder::GetRecordBatchReader()
  • Users can convert the unique_ptr to shared_ptr if they want

Are these changes tested?

Yes.

Are there any user-facing changes?

No. But arrow::Status parquet::arrow::FileReadeder::GetRecordBatchReader() are deprecated.

…r::GetRecordBatchReader()
Signed-off-by: Ziy1-Tan <ajb459684460@gmail.com>
@Ziy1-Tan
Ziy1-Tan requested a review from wgtmac as a code ownerJune 29, 2025 08:44
@Ziy1-TanZiy1-Tan changed the title GH-46869: [C++][Parquet] Add arrow::Result version of parquet::arrow::FileReader::GetRecordBatchReader()GH-46869: [C++][Parquet] Add arrow::Result version of parquet::arrow::FileReader::GetRecordBatchReader()Jun 29, 2025
@github-actionsgithub-actionsBot added the awaiting review Awaiting review label Jun 29, 2025
@wgtmac

Copy link
Copy Markdown
Member

It would be better to change all test cases to use new non-deprecated apis.

@Ziy1-Tan

Copy link
Copy Markdown
ContributorAuthor

It would be better to change all test cases to use new non-deprecated apis.

It is only used by example before:

std::shared_ptr<::arrow::RecordBatchReader> rb_reader;
ARROW_ASSIGN_OR_RAISE(rb_reader, arrow_reader->GetRecordBatchReader());

@wgtmacwgtmac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment threadcpp/src/parquet/arrow/reader.h Outdated
/// \returns error Status if either row_group_indices or column_indices
/// contains an invalid index
/// \deprecated Deprecated in future release. Use arrow::Result version instead.
ARROW_DEPRECATED("Deprecated in future release. Use arrow::Result version instead.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we specify a clear deprecated version? It should be 21.0.0 for now. (Note that there will be a feature freeze on July 1st)

Comment threadcpp/src/parquet/arrow/reader.h Outdated
/// \returns error Result if either row_group_indices or column_indices
/// contains an invalid index
virtual ::arrow::Result<std::shared_ptr<::arrow::RecordBatchReader>>
GetRecordBatchReaderSharedPtr(const std::vector<int>& row_group_indices,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GetRecordBatchReaderSharedPtr(conststd::vector<int>&row_group_indices,
GetRecordBatchReader(conststd::vector<int>&row_group_indices,

Can we avoid adding SharedPtr to be consistent?

@Ziy1-TanZiy1-TanJul 1, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetRecordBatchReader is used by Result<std::unique_ptr<RecordBatchReader>> GetRecordBatchReader now. @wgtmac, Do you have better nameing of this? Or remove shared_ptr version completely.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, then we don't need this new method as users can convert the unique_ptr to shared_ptr if they want.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kou .

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @pitrou that these new functions are essentially duplicate.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry.

@github-actionsgithub-actionsBot added awaiting committer review Awaiting committer review awaiting review Awaiting review Component: Parquet Component: C++ awaiting changes Awaiting changes and removed awaiting review Awaiting review awaiting committer review Awaiting committer review labels Jun 30, 2025

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the PR description?

Comment threadcpp/src/parquet/arrow/reader.cc Outdated
Comment on lines 1313 to 1334

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you keep them? Users who still use old API use them.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add these back again.

@Ziy1-TanZiy1-Tan changed the title GH-46869: [C++][Parquet] Add arrow::Result version of parquet::arrow::FileReader::GetRecordBatchReader()GH-46869: [C++][Parquet] Deprecate arrow::Status parquet::arrow::FileReadeder::GetRecordBatchReader()Jul 2, 2025
@github-actionsgithub-actionsBot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jul 2, 2025
@Ziy1-TanZiy1-Tan changed the title GH-46869: [C++][Parquet] Deprecate arrow::Status parquet::arrow::FileReadeder::GetRecordBatchReader()GH-46869: [C++][Parquet] Deprecate arrow::Status parquet::arrow::FileReadeder::GetRecordBatchReader()Jul 2, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to change this, right?

Comment threadcpp/src/parquet/arrow/reader.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be 21.0.0 (if we can merge this before the code freeze; otherwise 22.0.0)

Signed-off-by: Ziy1-Tan <ajb459684460@gmail.com>
kou
kou approved these changes Jul 3, 2025

@koukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@github-actionsgithub-actionsBot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Jul 3, 2025
@mapleFU

Copy link
Copy Markdown
Member

I have same issue here: #46932 (comment) . would this in 21.0 or be 22.0?

@kou

kou commented Jul 4, 2025

Copy link
Copy Markdown
Member

We don't have a release branch for 21.0.0 yet. So let's merge this for 21.0.0.

@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit f6ea922.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Ziy1-Tan@wgtmac@mapleFU@kou@pitrou