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

Can't filter rowgroup for parquet prune for some data type #2962

Closed
liukun4515 opened this issue Jul 25, 2022 · 2 comments · Fixed by #2966
Closed

Can't filter rowgroup for parquet prune for some data type #2962

liukun4515 opened this issue Jul 25, 2022 · 2 comments · Fixed by #2966
Labels
bug Something isn't working

Comments

@liukun4515
Copy link
Contributor

Describe the bug
In the RowGroupPruningStatistics, we use the statistics to prune the row group for parquet file.

In the below logical:
https://github.com/apache/arrow-datafusion/blob/f386f7a7344d54455fe04d92248e373fac990e6d/datafusion/core/src/physical_plan/file_format/parquet.rs#L392
to get the min and max for a column.

But the logic has bug for the data type.

In the parquet, we can use INT32INT64 or BINARY to store decimal value, but in the below logical, we can't get the right type of the ArrayRef.
To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@mingmwang
Copy link
Contributor

@alamb
Regarding the parquet row group pruning, the current pruning logic covers the stats pruning which is common for any columnar storage who provides stats and can be reused. But for parquet format, it also has specific pruning like dict pruning, bloom filter pruning, those two types of pruning is not implemented yet. Maybe those two types of pruning should be part of the parquet arrow project. And in the current parquet reader implementation, I do not find a method we can use to read the dictionary page out and use it to construct a Set for filtering purpose.

@alamb
Copy link
Contributor

alamb commented Jul 28, 2022

Maybe those two types of pruning should be part of the parquet arrow project.

I suspect additional filter pushdown will require changes in both the parquet reader and then datafusion

I think there is work underway by @Ted-Jiang @liukun4515 @thinkharderdev and @tustvold to implement "Page Pruning" which I think may be what you are referring to here (it allows the parquet reader to skip materializing/decoding positions based on evaluating the predicates) -- the work is partially described in apache/arrow-rs#1191

In terms of using parquet bloom filters, I suspect that would also need work in parquet and datafusion, and I don't know of any efforts underway to do so. @shanisolomon added initial support to expose the bloom filter metadata in apache/arrow-rs#1309 and follow on PRs, but I believe they then implemented the Bloom Filtering in a closed source project (cc @zeevm who might know more)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants