Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RecordBatch::schema_ref #5474

Merged
merged 2 commits into from
Mar 6, 2024
Merged

Conversation

monkwire
Copy link
Contributor

@monkwire monkwire commented Mar 5, 2024

Which issue does this PR close?

This PR addresses the first part of #5342.

Closes #5463

Rationale for this change

This change allows users to directly borrow a schema from a RecordBatch. While it is more idiomatic to achieve this using the existing RecordBatch::schema method (#5448 ) , this approach is less disruptive.

What changes are included in this PR?

The RecordBatch::schema_ref method is added. Additionally, .schema() is changed to .schema_ref() when the schema returned is treated as a borrowed value.

Are there any user-facing changes?

Yes, this adds a new a new method to RecordBatch.

@github-actions github-actions bot added parquet Changes to the parquet crate arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate labels Mar 5, 2024
@monkwire monkwire closed this Mar 6, 2024
@monkwire monkwire reopened this Mar 6, 2024
@tustvold
Copy link
Contributor

tustvold commented Mar 6, 2024

Thank you

@tustvold tustvold merged commit 1553267 into apache:master Mar 6, 2024
46 of 54 checks passed
@monkwire monkwire deleted the addschema_refmethod branch March 6, 2024 03:23
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you very much @monkwire and @tustvold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DISCUSSION] Better borrow propagation (e.g. RecordBatch::schema() to return &SchemaRef vs SchemaRef)
3 participants