Examples: boundary analysis example for AND/OR
conjunctions
#14735
+240
−13
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.
Which issue does this PR close?
Rationale for this change
The goal of this change is to supplement the example in #14688 with a more useful example that demonstrates the current state of boundary analysis for
AND
conjunctions; we also explain and show thatOR
conjunctions are not currently supported.What changes are included in this PR?
In
datafusion-examples/examples/expr_api.rs
there is now a new function that explains data flow during boundary analysis and selectivity calculation for the expressionage > 18 and <= 25
with some comments to explain whatthe logic under the hood does.
In a separate commit, we are also adding a brief explainer of the boundary analysis framework to the Query Optimizer section in the library guide. The goal is to have some supporting documentation that collects, summaries and distills
the information currently documented in the different pull requests and the original design doc (see #3929).
Are these changes tested?
The change re-uses parts of the API that are already covered by existing tests.
Are there any user-facing changes?
Yes, this introduces a new example.