apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
5.47k stars 1.01k forks source link

Support `String/LargeString` and `Binary/LargeBinary` and `FixedSizeBinary` Parquet Data Page Statistics #11026

Open alamb opened 1 week ago

alamb commented 1 week ago

Is your feature request related to a problem or challenge?

Part of https://github.com/apache/datafusion/issues/10922

We are adding APIs to efficiently convert the data stored in Parquet's "PageIndex" into ArrayRefs -- which will make it significiantly 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

https://github.com/apache/datafusion/blob/a923c659cf932f6369f2d5257e5b99128b67091a/datafusion/core/src/datasource/physical_plan/parquet/statistics.rs#L637-L656

Describe alternatives you've considered

You can follow the model from @Weijun-H in https://github.com/apache/datafusion/pull/10931

  1. Update the test for the listed data types (I think it is test_binary) following the model of test_int64 https://github.com/apache/datafusion/blob/a923c659cf932f6369f2d5257e5b99128b67091a/datafusion/core/tests/parquet/arrow_statistics.rs#L506-L529

  2. Add any required implementation in https://github.com/apache/datafusion/blob/2f4347647172f6997448b2e24d322b50c856f3a0/datafusion/core/src/datasource/physical_plan/parquet/statistics.rs#L575-L586 (follow the model of the row counts, https://github.com/apache/datafusion/blob/2f4347647172f6997448b2e24d322b50c856f3a0/datafusion/core/src/datasource/physical_plan/parquet/statistics.rs#L90)

Additional context

No response

PsiACE commented 1 week ago

take

alamb commented 4 days ago

Hi @PsiACE -- I was wondering how you were faring with this ticket?

PsiACE commented 4 days ago

Hi @PsiACE -- I was wondering how you were faring with this ticket?

Today I will submit a PR.

alamb commented 3 days ago

BTW @tshauck added a PR https://github.com/apache/arrow-rs/issues/5949 upstream in parquet-rs (not yet available in datafusion) that might make this easier