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

Make RowSelection::from_consecutive_ranges public #5846

Closed
alamb opened this issue Jun 5, 2024 · 2 comments · Fixed by #5848
Closed

Make RowSelection::from_consecutive_ranges public #5846

alamb opened this issue Jun 5, 2024 · 2 comments · Fixed by #5848
Labels
enhancement Any new improvement worthy of a entry in the changelog parquet Changes to the parquet crate

Comments

@alamb
Copy link
Contributor

alamb commented Jun 5, 2024

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

@advancedxy noted in https://github.com/apache/datafusion/pull/10738/files#r1627775856 that keeping track of skip/scan in coe like

let row_selection = RowSelection::from(vec![
    RowSelector::skip(100),
    RowSelector::select(100),
    RowSelector::skip(150),
    RowSelector::select(50),
])

is hard and it is easier to undersand and more concise to use from_consecutive_ranges

let row_selection = RowSelection::from_consecutive_ranges(vec![100..200, 350..400]);

Sadly, this function is not public:

error[E0624]: associated function `from_consecutive_ranges` is private
   --> datafusion/core/src/datasource/physical_plan/parquet/access_plan.rs:43:35
    |
11  |   let row_selection = RowSelection::from_consecutive_ranges(vec![100..200, 350..400]);
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^ private associated function
    |
   ::: /Users/andrewlamb/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parquet-51.0.0/src/arrow/arrow_reader/selection.rs:118:5
    |
118 | /     pub(crate) fn from_consecutive_ranges<I: Iterator<Item = Range<usize>>>(
119 | |         ranges: I,
120 | |         total_rows: usize,
121 | |     ) -> Self {

**Describe the solution you'd like**
Make `RowSelection::from_consecutive_ranges` public so it can be used by other crates 

**Describe alternatives you've considered**
<!--
A clear and concise description of any alternative solutions or features you've considered.
-->

**Additional context**
<!--
Add any other context or screenshots about the feature request here.
-->
@alamb alamb added the enhancement Any new improvement worthy of a entry in the changelog label Jun 5, 2024
@tustvold
Copy link
Contributor

tustvold commented Jun 5, 2024

IIRC it was only private because if you gave it non-consecutive ranges the behaviour might be erratic. I don't feel strongly about keeping it private

@alamb alamb added the parquet Changes to the parquet crate label Jul 2, 2024
@alamb
Copy link
Contributor Author

alamb commented Jul 2, 2024

label_issue.py automatically added labels {'parquet'} from #5848

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants