Skip to content

Remove unnecessary Arc<ArrayRef>#9316

Merged
scovich merged 5 commits into
apache:mainfrom
scovich:no-arc-arc-array
Feb 3, 2026
Merged

Remove unnecessary Arc<ArrayRef>#9316
scovich merged 5 commits into
apache:mainfrom
scovich:no-arc-arc-array

Conversation

@scovich

@scovich scovich commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Because Arc<dyn Array> (ArrayRef) implements Array, it's easy to create redundant Arc<Arc<dyn Array>>. The extra indirection is pure overhead (both cognitive and runtime) with no benefit.

What changes are included in this PR?

Remove the redundant wrapping.

Are these changes tested?

Compilation suffices -- failing to wrap a concrete array type in Arc would cause compilation failures.

Are there any user-facing changes?

No.

@scovich scovich requested review from alamb and tustvold January 31, 2026 03:32
@github-actions github-actions Bot added parquet Changes to the parquet crate arrow Changes to the arrow crate parquet-variant parquet-variant* crates labels Jan 31, 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.

Looks great to me

DataType::Dictionary(_, _) => {
let array = array.as_any_dictionary();
let values = date_part(array.values(), part)?;
let values = Arc::new(values) as ArrayRef;

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.

🤦

Comment thread arrow-ipc/src/reader.rs Outdated
@scovich

scovich commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

Note: This PR is really just fixing the examples I found so far. I suspect I found them all (by removing the impl Array for Arc<dyn Array> and seeing what broke), but nothing stops new bad examples from showing up in the future. I even found a bad example in my own code (variant builder), so I know it's easy to miss!

@scovich

scovich commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

@alamb -- something seems to have gone wrong with CI -- one job failed to acquire an instance to run on, and after 15 minutes everything canceled. Is that normal?

@alamb

alamb commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Close/reopen to retrigger CI

@alamb alamb closed this Feb 2, 2026
@alamb alamb reopened this Feb 2, 2026
@scovich

scovich commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

Same thing again...

arrow_flight / Clippy (pull_request) Canceled after 76m
The job was not acquired by Runner of type hosted even after multiple attempts

@alamb

alamb commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

https://www.githubstatus.com/

Screenshot 2026-02-02 at 6 13 41 PM

Appears to be github related

@Jefffrey Jefffrey closed this Feb 3, 2026
@Jefffrey Jefffrey reopened this Feb 3, 2026
@scovich scovich merged commit 53a1614 into apache:main Feb 3, 2026
34 of 96 checks passed
@alamb

alamb commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Woohoo!

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 parquet Changes to the parquet crate parquet-variant parquet-variant* crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants