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

Support Time Parquet Data Page Statistics #11114

Closed
Tracked by #10922
alamb opened this issue Jun 24, 2024 · 6 comments · Fixed by #11187
Closed
Tracked by #10922

Support Time Parquet Data Page Statistics #11114

alamb opened this issue Jun 24, 2024 · 6 comments · Fixed by #11187
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented Jun 24, 2024

Is your feature request related to a problem or challenge?

Part of #10922

We are adding APIs to efficiently convert the data stored in Parquet's "PageIndex" into ArrayRefs -- which will make it significantly easier to use this information for pruning and other tasks.

Describe the solution you'd like

Add support to StatisticsConverter::min_page_statistics and StatisticsConverter::max_page_statistics for the types above

/// of parquet page [`Index`]'es to an [`ArrayRef`]
pub(crate) fn min_page_statistics<'a, I>(
data_type: Option<&DataType>,
iterator: I,
) -> Result<ArrayRef>
where
I: Iterator<Item = (usize, &'a Index)>,
{
get_data_page_statistics!(Min, data_type, iterator)
}
/// Extracts the max statistics from an iterator
/// of parquet page [`Index`]'es to an [`ArrayRef`]
pub(crate) fn max_page_statistics<'a, I>(
data_type: Option<&DataType>,
iterator: I,
) -> Result<ArrayRef>
where
I: Iterator<Item = (usize, &'a Index)>,
{

Describe alternatives you've considered

You can follow the model from @Weijun-H in #10931

  1. Update the test for the listed data types to be Check::Both, following the model of test_int64
    async fn test_int_64() {
    // This creates a parquet files of 4 columns named "i8", "i16", "i32", "i64"
    let reader = TestReader {
    scenario: Scenario::Int,
    row_per_group: 5,
    }
    .build()
    .await;
    // since each row has only one data page, the statistics are the same
    Test {
    reader: &reader,
    // mins are [-5, -4, 0, 5]
    expected_min: Arc::new(Int64Array::from(vec![-5, -4, 0, 5])),
    // maxes are [-1, 0, 4, 9]
    expected_max: Arc::new(Int64Array::from(vec![-1, 0, 4, 9])),
    // nulls are [0, 0, 0, 0]
    expected_null_counts: UInt64Array::from(vec![0, 0, 0, 0]),
    // row counts are [5, 5, 5, 5]
    expected_row_counts: UInt64Array::from(vec![5, 5, 5, 5]),
    column_name: "i64",
    check: Check::Both,
    }
    .run();
  2. Add any required implementation in get_datapage_statistics: (follow the model of the row counts, )

Typically the change to the test looks like

- check: Check::RowGroup, 
+ check: Check::Both, 

Additional context

No response

@myeunee
Copy link

myeunee commented Jun 25, 2024

Can I work on this issue? kindly assign it to me!

@MohamedAbdeen21
Copy link
Contributor

Hi @myeunee, you can just comment "take" and it will be automatically assigned to you.

@alamb
Copy link
Contributor Author

alamb commented Jun 25, 2024

Can I work on this issue? kindly assign it to me!

Also in general, feel free to work on any issue -- https://datafusion.apache.org/contributor-guide/index.html#finding-and-creating-issues-to-work-on 🚀

@alamb
Copy link
Contributor Author

alamb commented Jun 30, 2024

It looks like this issue is one of the last needed to complete the data page statistics extraction feature 🤔

@dharanad
Copy link
Contributor

@alamb Since this is the only thing pending. I took the liberty to quickly jump in and raised a PR.
@myeunee Please excuse me.

@alamb
Copy link
Contributor Author

alamb commented Jun 30, 2024

Thank you @dharanad

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants