Skip to content

Comments

[Minor] Use buffer_unordered#20462

Merged
Dandandan merged 4 commits intoapache:mainfrom
Dandandan:buffer_unordered
Feb 22, 2026
Merged

[Minor] Use buffer_unordered#20462
Dandandan merged 4 commits intoapache:mainfrom
Dandandan:buffer_unordered

Conversation

@Dandandan
Copy link
Contributor

Which issue does this PR close?

  • Closes #.

Rationale for this change

buffer_unordered should be slightly better here - as we sort by the paths anyway (perhaps we can reduce the default concurrency).

Also remove some unnecessary allocations.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the datasource Changes to the datasource crate label Feb 21, 2026
// sort the files first.
// https://github.com/apache/datafusion/pull/6629
schemas.sort_by(|(location1, _), (location2, _)| location1.cmp(location2));
schemas
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove allocation during sort

.into_iter()
.map(|(_, schema)| schema)
.collect::<Vec<_>>();
let schemas = schemas.into_iter().map(|(_, schema)| schema);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove one more allocation

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @Dandandan if I understood correctly the order doesn't matter in modified scenarios?

@Dandandan
Copy link
Contributor Author

Thanks @Dandandan if I understood correctly the order doesn't matter in modified scenarios?

The order doesn't matter as it is sorted afterwards.

@Dandandan Dandandan added this pull request to the merge queue Feb 22, 2026
Merged via the queue into apache:main with commit c1ad863 Feb 22, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants