Skip to content

Commit e5b6d97

Browse files
authored
minor: Fix an example in the PruningPredicate documentation (apache#18742)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> I noticed one rewritten predicate in the `PruningPredicate` documentation might not be correct. I have tried with example `datafusion/datafusion-examples/examples/query_planning/pruning.rs` to generate the rewritten predicate to confirm it: `x<5: x_null_count@1 != row_count@2 AND x_min@0 < 5` ### Fun side story I came across a thread on V2EX (a Chinese technical-ish community) titled “Have you ever read a technical book that felt truly satisfying?” Someone replied with a very specific section from the DataFusion documentation comment (the one this PR updates) <img width="964" height="155" alt="image" src="https://github.com/user-attachments/assets/c3c5f7f5-1b01-4cc6-ad96-8ab59560db24" /> I’ve read it — and it’s true 😆 , truly satisfying. I believe @alamb originally wrote it. ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
1 parent 0424eaa commit e5b6d97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

datafusion/pruning/src/pruning_predicate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ use datafusion_physical_plan::{ColumnarValue, PhysicalExpr};
238238
/// Original Predicate | Rewritten Predicate
239239
/// ------------------ | --------------------
240240
/// `x = 5` | `x_null_count != x_row_count AND (x_min <= 5 AND 5 <= x_max)`
241-
/// `x < 5` | `x_null_count != x_row_count THEN false (x_max < 5)`
241+
/// `x < 5` | `x_null_count != x_row_count AND (x_min < 5)`
242242
/// `x = 5 AND y = 10` | `x_null_count != x_row_count AND (x_min <= 5 AND 5 <= x_max) AND y_null_count != y_row_count (y_min <= 10 AND 10 <= y_max)`
243243
/// `x IS NULL` | `x_null_count > 0`
244244
/// `x IS NOT NULL` | `x_null_count != row_count`

0 commit comments

Comments
 (0)