Skip to content

Add Metadata Arc helper methods - #10693

Merged
alamb merged 1 commit into
apache:mainfrom
Rich-T-kid:rich-t-kid/metadata-expose-arc
Aug 18, 2026
Merged

alamb merged 1 commit into
apache:mainfrom
Rich-T-kid:rich-t-kid/metadata-expose-arc

Conversation

@Rich-T-kid

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

see #10684

What changes are included in this PR?

two new method

  • as_arc(&self) : Option<&Arc<BTreeMap<String, String>>> returns a reference to the inner Arc (or None for empty).
  • into_arc(self) :Option<Arc<BTreeMap<String, String>>> consumes self and hands back the Arc directly, enabling zero-copy conversions

Are these changes tested?

yes

Are there any user-facing changes?

yes, new public methods as_arc & into_arc on Metadata.

@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-schema labels Aug 15, 2026

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @Rich-T-kid

Any concerns about this one @emilk ?

@alamb alamb changed the title support metadata arc helper methods Add Metadata Arc helper methods Aug 15, 2026
@emilk

emilk commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Looks good to me.

For symmetry, it would probably make sense to also have a way to construct the Metadata from a Arc<BTreeMap<String, String>> (just make sure to treat is_empty() as None)

@Rich-T-kid

Copy link
Copy Markdown
Contributor Author

Looks good to me.

For symmetry, it would probably make sense to also have a way to construct the Metadata from a Arc<BTreeMap<String, String>> (just make sure to treat is_empty() as None)

@emilk I think this already exist

impl From<Arc<BTreeMap<String, String>>> for Metadata {

@emilk

emilk commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Ah great - missed it :)

@alamb
alamb merged commit 842de75 into apache:main Aug 18, 2026
35 checks passed
@alamb

alamb commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Thank you both

@Jefffrey Jefffrey added the enhancement New feature/addition label Aug 19, 2026
MassivePizza pushed a commit to massive-com/arrow-rs that referenced this pull request Aug 19, 2026
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes apache#10684.

# Rationale for this change

see apache#10684

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

# What changes are included in this PR?

two new method 
- `as_arc(&self) : Option<&Arc<BTreeMap<String, String>>>` returns a
reference to the inner Arc (or None for empty).
- `into_arc(self) :Option<Arc<BTreeMap<String, String>>>` consumes self
and hands back the Arc directly, enabling zero-copy conversions
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
yes
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

# Are there any user-facing changes?

yes, new public methods `as_arc` & `into_arc` on Metadata.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
Rich-T-kid added a commit to Rich-T-kid/arrow-rs that referenced this pull request Aug 26, 2026
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes apache#10684.

# Rationale for this change

see apache#10684

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

# What changes are included in this PR?

two new method 
- `as_arc(&self) : Option<&Arc<BTreeMap<String, String>>>` returns a
reference to the inner Arc (or None for empty).
- `into_arc(self) :Option<Arc<BTreeMap<String, String>>>` consumes self
and hands back the Arc directly, enabling zero-copy conversions
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
yes
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

# Are there any user-facing changes?

yes, new public methods `as_arc` & `into_arc` on Metadata.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
Rich-T-kid added a commit to Rich-T-kid/arrow-rs that referenced this pull request Aug 28, 2026
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes apache#10684.

# Rationale for this change

see apache#10684

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

# What changes are included in this PR?

two new method 
- `as_arc(&self) : Option<&Arc<BTreeMap<String, String>>>` returns a
reference to the inner Arc (or None for empty).
- `into_arc(self) :Option<Arc<BTreeMap<String, String>>>` consumes self
and hands back the Arc directly, enabling zero-copy conversions
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
yes
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

# Are there any user-facing changes?

yes, new public methods `as_arc` & `into_arc` on Metadata.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
Rich-T-kid added a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 2, 2026
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes apache#10684.

# Rationale for this change

see apache#10684

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

# What changes are included in this PR?

two new method 
- `as_arc(&self) : Option<&Arc<BTreeMap<String, String>>>` returns a
reference to the inner Arc (or None for empty).
- `into_arc(self) :Option<Arc<BTreeMap<String, String>>>` consumes self
and hands back the Arc directly, enabling zero-copy conversions
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
yes
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

# Are there any user-facing changes?

yes, new public methods `as_arc` & `into_arc` on Metadata.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
Rich-T-kid added a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 18, 2026
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes apache#10684.

# Rationale for this change

see apache#10684

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

# What changes are included in this PR?

two new method 
- `as_arc(&self) : Option<&Arc<BTreeMap<String, String>>>` returns a
reference to the inner Arc (or None for empty).
- `into_arc(self) :Option<Arc<BTreeMap<String, String>>>` consumes self
and hands back the Arc directly, enabling zero-copy conversions
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
yes
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

# Are there any user-facing changes?

yes, new public methods `as_arc` & `into_arc` on Metadata.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
Rich-T-kid added a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 21, 2026
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes apache#10684.

# Rationale for this change

see apache#10684

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

# What changes are included in this PR?

two new method 
- `as_arc(&self) : Option<&Arc<BTreeMap<String, String>>>` returns a
reference to the inner Arc (or None for empty).
- `into_arc(self) :Option<Arc<BTreeMap<String, String>>>` consumes self
and hands back the Arc directly, enabling zero-copy conversions
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
yes
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

# Are there any user-facing changes?

yes, new public methods `as_arc` & `into_arc` on Metadata.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
Rich-T-kid added a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 25, 2026
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes apache#10684.

# Rationale for this change

see apache#10684

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

# What changes are included in this PR?

two new method 
- `as_arc(&self) : Option<&Arc<BTreeMap<String, String>>>` returns a
reference to the inner Arc (or None for empty).
- `into_arc(self) :Option<Arc<BTreeMap<String, String>>>` consumes self
and hands back the Arc directly, enabling zero-copy conversions
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
yes
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->

# Are there any user-facing changes?

yes, new public methods `as_arc` & `into_arc` on Metadata.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
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-schema enhancement New feature/addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose Metadata's inner Arc (e.g. as_arc / into_arc)

4 participants