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

Skip useless pruning predicates in ParquetExec #4280

Merged
merged 2 commits into from
Nov 18, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Nov 18, 2022

Which issue does this PR close?

Draft as it builds on #4278

re #4020

Rationale for this change

If a predicate can't be turned into a pruning predicate, it is converted to "true" and will not prune anything. However, the parquet exec will still attempt to read and create statistics in this case which is wasteful (as nothing can be pruned)

After #4278 it is also confusing to see pruning_predicate=true in the explain plan

What changes are included in this PR?

  1. Check for, and ignore pruning predicates that are always true

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions bot added the core Core DataFusion crate label Nov 18, 2022
@alamb alamb force-pushed the alamb/skip_useless_pushdown_predicates branch from 2b10d68 to 49fb6dd Compare November 18, 2022 12:11
@alamb alamb changed the title Skip useless pruning predicates in parquet exec Skip useless pruning predicates in ParquetExec Nov 18, 2022
@alamb alamb force-pushed the alamb/skip_useless_pushdown_predicates branch from 49fb6dd to 12a2795 Compare November 18, 2022 13:37
@alamb alamb marked this pull request as ready for review November 18, 2022 13:37
@alamb
Copy link
Contributor Author

alamb commented Nov 18, 2022

Sorry for the rapid fire PRs @Ted-Jiang and @thinkharderdev -- I figured i would try and keep them small to make review easier

Co-authored-by: Daniël Heres <danielheres@gmail.com>
Copy link
Member

@Ted-Jiang Ted-Jiang left a comment

Choose a reason for hiding this comment

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

Nice catch!

@alamb
Copy link
Contributor Author

alamb commented Nov 18, 2022

Nice catch!

For what it is worth, I found these while updating IOx and some our explain plans show true https://github.com/influxdata/influxdb_iox/pull/6042#discussion_r1026289246

So testing for the win!

@alamb alamb merged commit a584ff5 into apache:master Nov 18, 2022
@alamb alamb deleted the alamb/skip_useless_pushdown_predicates branch November 18, 2022 16:19
@ursabot
Copy link

ursabot commented Nov 18, 2022

Benchmark runs are scheduled for baseline = 949d5af and contender = a584ff5. a584ff5 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@alamb
Copy link
Contributor Author

alamb commented Nov 19, 2022

So last night I realized that this PR likely broke predicate pushdown for certain predicates -- specifically since the pushdown filters are taken from the pruning predicate, by dropping the pruning predicate we will ensure no pushdown happens as the filter is no longer available.

Rather than back this PR out, however, I think we should forge ahead with properly saving the original predicate, as I have done in #4279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants