-
Notifications
You must be signed in to change notification settings - Fork 172
Migrate to new stats falsification rules #8345
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
5b6a862
Make stats rewrite rules public
gatesn e8dd011
Centralize stat expression binding
gatesn c1d6d94
Fix file stats binding for computed expressions
gatesn 468ebfd
Fuse checked pruning stats rewrites
gatesn cd48674
Simplify stats binding null handling
gatesn 52fd443
Install Java toolchain in CI
gatesn 4293838
Remove legacy stat falsification hooks
gatesn ffbccee
Remove legacy stat expression hooks
gatesn 1c81fb4
Merge remote-tracking branch 'origin/develop' into ngates/public-stat…
gatesn fe12e71
Address stats binding review comments
gatesn 0de2c09
Bind abstract aggregate stats to legacy counts
gatesn 118c995
Document aggregate stat binding coverage
gatesn 32241d2
Make legacy stat aggregate binding explicit
gatesn 360aa58
Make stats binders immutable
gatesn ec94e69
Remove required stats pruning binder
gatesn fff66b6
Restore session falsification tests
gatesn 25e9400
Bind only direct stat aggregates
gatesn b222454
Split NaN stat rewrite proofs
gatesn e82764f
Use concrete stat terminology
gatesn 619706f
Inline stats rewrite proof variants
gatesn 9a7c766
Split stats rewrite rule structs
gatesn 91fc94f
Clean up stats rewrite proof helpers
gatesn 22cd9de
Preserve DuckDB filter order
gatesn d81033e
Restore integer Delta compression scheme
gatesn baae2dd
Address stats pruning review comments
gatesn db78444
Merge remote-tracking branch 'origin/develop' into ngates/public-stat…
gatesn 9a737c9
Address follow-up stats rewrite review comments
gatesn 83b1332
Localize legacy stat aggregate binding
gatesn 4dac595
Fix DuckDB projection test compile
gatesn 3e7c2d6
Keep stats binding free of reduction
gatesn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Stats Pruning | ||
|
|
||
| Vortex uses statistics to prove when a filter cannot match a row group, zone, or | ||
| file. The proof expression returns `true` when the input can be skipped. It | ||
| returns `false` or `null` when pruning is not proven. | ||
|
|
||
| Both `false` and `null` are non-pruning outcomes, but they mean different | ||
| things. `false` means the available stats disproved the skip proof. `null` means | ||
| the proof was unknown, usually because a required stat was missing or inexact. | ||
|
|
||
| The pruning pipeline has two phases: | ||
|
|
||
| 1. `Expression::falsify(scope, session)` asks the session's | ||
| `StatsRewriteRule`s to rewrite a filter into an abstract proof expression. | ||
| Rules describe semantics in terms of `vortex.stat(input, aggregate_fn)` | ||
| placeholders. These placeholders name the statistic needed by the proof, but | ||
| not where that statistic is stored. | ||
| 2. `bind_stats` lowers those abstract stat placeholders with a `StatBinder`. | ||
| The binder maps stats to the representation used by the caller, such as | ||
| zone-map table fields, file-level stat literals, or typed null literals for | ||
| missing stats. | ||
|
|
||
| Missing stats lower to typed null literals. This preserves the three-valued | ||
| logic used by pruning: only a non-null `true` value proves that the scope can be | ||
| skipped. A missing stat therefore cannot accidentally prune data. | ||
|
|
||
| ## Binding Targets | ||
|
|
||
| Zone maps bind stats to fields in their per-zone stats table. The lowered | ||
| expression is evaluated against that table and produces a mask where `true` | ||
| means the zone can be skipped. | ||
|
|
||
| File-level stats bind stats to literal values from the file footer. The lowered | ||
| expression is reduced and evaluated once for the full file. If it evaluates to | ||
| `true`, the file stats reader can return an all-false pruning mask without | ||
| reading child layouts. | ||
|
|
||
| For the layout model around these pruning points, see | ||
| [Layouts](../../concepts/layouts.md) and [Scanning](../../concepts/scanning.md). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its just easier to map nulls to nulls