You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kumarUjjawal (via GitHub)" <gi...@apache.org> on 2026/08/30 04:04:32 UTC
[PR] perf: use compact pruning for large string NOT IN lists [datafusion]
kumarUjjawal opened a new pull request, #24781:
URL: https://github.com/apache/datafusion/pull/24781
## 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.
-->
- Part of #24711.
## Rationale for this change
Large string NOT IN lists create long expression chains for Parquet pruning. These expressions are expensive to build and evaluate.
<!--
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.
Please explain the problem you are trying to solve in terms of the user-visible
behavior, rather than the implementation.
For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of the
implementation. "COUNT(DISTINCT) returns wrong results when the column contains
nulls" is the user-visible problem.
-->
## What changes are included in this PR?
- Use a compact sorted domain for large, non-null string NOT IN lists.
- Preserve the existing behavior for lists containing NULL.
- Add unit tests and Parquet row-group and page-pruning tests.
- Add a mixed-container regression test.
- Extend the existing benchmark and configuration documentation.
- In a local benchmark with 1,024 values, construction was about 17 times faster and evaluation was about 27 times faster.
<!--
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?
Yes
<!--
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?
No public API 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.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "adriangb (via GitHub)" <gi...@apache.org>.
adriangb merged PR #24781:
URL: https://github.com/apache/datafusion/pull/24781
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao commented on code in PR #24781:
URL: https://github.com/apache/datafusion/pull/24781#discussion_r3931041925
##########
datafusion/pruning/src/string_in_list.rs:
##########
@@ -27,48 +27,78 @@ use datafusion_common::{Result, assert_eq_or_internal_err};
use datafusion_physical_expr::{PhysicalExpr, PhysicalExprRef};
use datafusion_physical_plan::ColumnarValue;
-/// Tests whether a sorted string domain intersects an inclusive statistics interval.
+/// Which `IN` form a sorted string domain is pruning for.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
+pub(crate) enum SetMembership {
+ /// `col IN (...)`. A row matches only where the domain intersects the
+ /// interval, so a disjoint interval excludes every row.
+ In,
+ /// `col NOT IN (...)`. Overlap proves nothing here: values outside the
+ /// domain still satisfy the predicate. An interval excludes every row only
+ /// when it holds a single value that the domain contains.
+ NotIn,
+}
+
+/// Tests an inclusive statistics interval against a sorted string domain.
///
/// [`PhysicalExpr::evaluate`] returns one nullable Boolean per min/max interval:
-/// * `true`: the interval intersects the domain, so matching rows may exist.
-/// * `false`: the available bounds prove the interval disjoint from the domain.
+/// * `true`: matching rows may exist, so the container must be read.
+/// * `false`: the available bounds prove no row can match.
/// * `NULL`: incomplete, invalid, or unusable bounds prevent a safe decision.
///
-/// A single known bound can still prove disjointness. Otherwise, unknown results
-/// keep the container eligible for reading.
+/// [`SetMembership`] selects the test. For [`SetMembership::In`] a single known
+/// bound can still prove disjointness. For [`SetMembership::NotIn`], one known
+/// bound outside the domain proves the container may match, while two equal
+/// bounds in the domain prove it cannot. This is the same reach as the per-value
+/// `min != v OR v != max` chain it replaces. Otherwise, unknown results keep the
+/// container eligible for reading.
///
/// This expression is used only for pruning; the original IN remains the row filter.
#[derive(Debug, Eq)]
pub(crate) struct StringInListPruningExpr {
+ membership: SetMembership,
min: PhysicalExprRef,
max: PhysicalExprRef,
values: Arc<[String]>,
}
impl StringInListPruningExpr {
pub(crate) fn new(
+ membership: SetMembership,
min: PhysicalExprRef,
max: PhysicalExprRef,
mut values: Vec<String>,
) -> Self {
values.sort_unstable();
values.dedup();
Self {
+ membership,
min,
max,
values: values.into(),
}
}
+
+ /// Does the sorted, deduplicated domain hold `value`?
+ fn contains(&self, value: &[u8]) -> bool {
+ self.values
+ .binary_search_by(|candidate| candidate.as_bytes().cmp(value))
Review Comment:
[P2] Reject impossible string lengths before scanning shared prefixes
There is still a long-prefix regression when the list literals also share the statistics prefix. `contains()` performs lexicographic comparisons even when the bound and every candidate have different lengths. The former Arrow equality kernels reject these candidates by length without reading the string buffers.
For example, use cap 21, `prefix = "z".repeat(16384)`, literals `prefix + "domain00000000"` through `prefix + "domain00000020"`, and 4,096 Utf8View containers with `min = max = prefix + "a"`. Identical base/head probes keep every container, but prepared-statistics pruning takes 0.230 ms on base versus 8.96 ms here (about 39x). The added long-prefix benchmark uses short literals, so it misses this case.
This is a CPU regression, not an incorrect-result issue. It requires a raised cap and long untruncated/custom statistics; the default cap of 20 avoids the path, and the control with 64-byte bounds improved when construction was included. Actual Parquet metadata conversion is outside these timings.
Could we sort and search the existing `NOT IN` domain by `(byte length, bytes)`, using the same comparator in both places, while keeping positive `IN` lexicographically ordered for interval searches? That rejects absent lengths before scanning prefixes without adding another collection. Please also cover long literals sharing the bounds' prefix in the benchmark.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao commented on code in PR #24781:
URL: https://github.com/apache/datafusion/pull/24781#discussion_r3916354962
##########
datafusion/pruning/src/string_in_list.rs:
##########
@@ -151,19 +184,46 @@ impl PhysicalExpr for StringInListPruningExpr {
// uses actual Arrow partition values. PrunableStatistics
// trusts file providers' bounds: there is no ordering gate
// for arbitrary statistics providers here.
- let index = self.values.partition_point(|v| v.as_bytes() < min);
- Some(self.values.get(index).is_some_and(|v| v.as_bytes() <= max))
+ match self.membership {
+ SetMembership::In => {
+ let index =
+ self.values.partition_point(|v| v.as_bytes() < min);
+ Some(
+ self.values
+ .get(index)
+ .is_some_and(|v| v.as_bytes() <= max),
+ )
+ }
+ // A wider interval can always hold a value outside the
+ // domain, which satisfies NOT IN. Only an interval
+ // pinned to one domain value rules out every row.
+ // Truncated Parquet bounds cannot fake that: min
+ // truncates downward and max upward, so equal bounds
+ // mean the true values were equal too. This arm also
+ // compares for equality rather than order, so it does
+ // not rely on the bound ordering the IN arm needs.
+ SetMembership::NotIn => {
+ Some(min != max || !self.contains(min))
+ }
+ }
}
// A missing bound makes that end of the interval unbounded.
// Exclude only when the whole domain lies beyond the known bound;
// gaps within the domain and equality cannot prove disjointness.
+ // An unbounded interval is never single-valued, so NOT IN takes
+ // neither arm.
(Some(min), None)
- if self.values.last().is_some_and(|v| v.as_bytes() < min) =>
+ if self.membership == SetMembership::In
Review Comment:
[P2] Preserve the OR short circuit when only one bound is known
For `NOT IN`, these guards send every one-sided interval to `None`, including cases where the old comparison chain returned `true`. For example, with `s_min = 'zzz'`, absent `s_max`, and no null rows, every comparison in `s NOT IN ('a00', ..., 'a20')` is already true on the known bound. Returning NULL still keeps the same containers, but an enclosing OR now has to evaluate its other branch. Modern Parquet min/max fields are independently optional, and this metadata passes the existing ordering/trust checks.
I reproduced this with cap 1,024 and 4,096 Utf8View containers: `s NOT IN ('a00', ..., 'a20') OR n IN (0, 10, ..., 10230)`, with `n_min = n_max = 10229`, null counts 0 and row counts 128. Base pruning took 0.142 ms versus 5.46 ms here (about 38x); both retained every container. This is extra CPU, not incorrect data.
Could we add explicit `NotIn` arms that return `Some(true)` when the known bound is absent from the domain, keeping UNKNOWN when it is a domain member, and cover this composed-OR case?
##########
datafusion/pruning/src/string_in_list.rs:
##########
@@ -151,19 +184,46 @@ impl PhysicalExpr for StringInListPruningExpr {
// uses actual Arrow partition values. PrunableStatistics
// trusts file providers' bounds: there is no ordering gate
// for arbitrary statistics providers here.
- let index = self.values.partition_point(|v| v.as_bytes() < min);
- Some(self.values.get(index).is_some_and(|v| v.as_bytes() <= max))
+ match self.membership {
+ SetMembership::In => {
+ let index =
+ self.values.partition_point(|v| v.as_bytes() < min);
+ Some(
+ self.values
+ .get(index)
+ .is_some_and(|v| v.as_bytes() <= max),
+ )
+ }
+ // A wider interval can always hold a value outside the
+ // domain, which satisfies NOT IN. Only an interval
+ // pinned to one domain value rules out every row.
+ // Truncated Parquet bounds cannot fake that: min
+ // truncates downward and max upward, so equal bounds
+ // mean the true values were equal too. This arm also
+ // compares for equality rather than order, so it does
+ // not rely on the bound ordering the IN arm needs.
+ SetMembership::NotIn => {
+ Some(min != max || !self.contains(min))
Review Comment:
[P2] Avoid scanning long bounds before checking domain membership
This new path first goes through `min > max` above, then evaluates `min != max` before looking in the domain. Both comparisons can scan the entire common prefix even when short list literals could reject `min` immediately. The previous per-literal equality kernels reject such values using their length/prefix.
With cap 21, literals `a00000000` through `a00000020`, and 4,096 Utf8View containers whose bounds are `"z".repeat(16384) + "a"` and `"z".repeat(16384) + "z"`, pruning took 0.229 ms on base versus 6.63 ms here (about 29x), with identical keep decisions. These are prepared-statistics pruning timings; actual Parquet statistics conversion adds work in both versions. The case is reachable with larger/untruncated statistics or custom statistics providers, while the default writer's 64-byte truncation limits exposure.
Could we handle `NotIn` before the ordering guard and use a domain-membership rejection before comparing the full bounds, with a benchmark for long common prefixes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on code in PR #24781:
URL: https://github.com/apache/datafusion/pull/24781#discussion_r3921339965
##########
datafusion/pruning/src/string_in_list.rs:
##########
@@ -151,19 +184,46 @@ impl PhysicalExpr for StringInListPruningExpr {
// uses actual Arrow partition values. PrunableStatistics
// trusts file providers' bounds: there is no ordering gate
// for arbitrary statistics providers here.
- let index = self.values.partition_point(|v| v.as_bytes() < min);
- Some(self.values.get(index).is_some_and(|v| v.as_bytes() <= max))
+ match self.membership {
+ SetMembership::In => {
+ let index =
+ self.values.partition_point(|v| v.as_bytes() < min);
+ Some(
+ self.values
+ .get(index)
+ .is_some_and(|v| v.as_bytes() <= max),
+ )
+ }
+ // A wider interval can always hold a value outside the
+ // domain, which satisfies NOT IN. Only an interval
+ // pinned to one domain value rules out every row.
+ // Truncated Parquet bounds cannot fake that: min
+ // truncates downward and max upward, so equal bounds
Review Comment:
done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on code in PR #24781:
URL: https://github.com/apache/datafusion/pull/24781#discussion_r3921338829
##########
datafusion/pruning/src/string_in_list.rs:
##########
@@ -151,19 +184,46 @@ impl PhysicalExpr for StringInListPruningExpr {
// uses actual Arrow partition values. PrunableStatistics
// trusts file providers' bounds: there is no ordering gate
// for arbitrary statistics providers here.
- let index = self.values.partition_point(|v| v.as_bytes() < min);
- Some(self.values.get(index).is_some_and(|v| v.as_bytes() <= max))
+ match self.membership {
+ SetMembership::In => {
+ let index =
+ self.values.partition_point(|v| v.as_bytes() < min);
+ Some(
+ self.values
+ .get(index)
+ .is_some_and(|v| v.as_bytes() <= max),
+ )
+ }
+ // A wider interval can always hold a value outside the
+ // domain, which satisfies NOT IN. Only an interval
+ // pinned to one domain value rules out every row.
+ // Truncated Parquet bounds cannot fake that: min
+ // truncates downward and max upward, so equal bounds
+ // mean the true values were equal too. This arm also
+ // compares for equality rather than order, so it does
+ // not rely on the bound ordering the IN arm needs.
+ SetMembership::NotIn => {
+ Some(min != max || !self.contains(min))
+ }
+ }
}
// A missing bound makes that end of the interval unbounded.
// Exclude only when the whole domain lies beyond the known bound;
// gaps within the domain and equality cannot prove disjointness.
+ // An unbounded interval is never single-valued, so NOT IN takes
+ // neither arm.
(Some(min), None)
- if self.values.last().is_some_and(|v| v.as_bytes() < min) =>
+ if self.membership == SetMembership::In
Review Comment:
done!
##########
datafusion/pruning/src/string_in_list.rs:
##########
@@ -151,19 +184,46 @@ impl PhysicalExpr for StringInListPruningExpr {
// uses actual Arrow partition values. PrunableStatistics
// trusts file providers' bounds: there is no ordering gate
// for arbitrary statistics providers here.
- let index = self.values.partition_point(|v| v.as_bytes() < min);
- Some(self.values.get(index).is_some_and(|v| v.as_bytes() <= max))
+ match self.membership {
+ SetMembership::In => {
+ let index =
+ self.values.partition_point(|v| v.as_bytes() < min);
+ Some(
+ self.values
+ .get(index)
+ .is_some_and(|v| v.as_bytes() <= max),
+ )
+ }
+ // A wider interval can always hold a value outside the
+ // domain, which satisfies NOT IN. Only an interval
+ // pinned to one domain value rules out every row.
+ // Truncated Parquet bounds cannot fake that: min
+ // truncates downward and max upward, so equal bounds
+ // mean the true values were equal too. This arm also
+ // compares for equality rather than order, so it does
+ // not rely on the bound ordering the IN arm needs.
+ SetMembership::NotIn => {
+ Some(min != max || !self.contains(min))
Review Comment:
done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "adriangb (via GitHub)" <gi...@apache.org>.
adriangb commented on PR #24781:
URL: https://github.com/apache/datafusion/pull/24781#issuecomment-5466771946
@sunchao would you be interested in reviewing @kumarUjjawal's work?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24781:
URL: https://github.com/apache/datafusion/pull/24781#issuecomment-5466698223
## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/24781?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `88.57143%` with `24 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 81.53%. Comparing base ([`4ada0dc`](https://app.codecov.io/gh/apache/datafusion/commit/4ada0dcabbf502f751a7c21cf6cb642154637af9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6241218`](https://app.codecov.io/gh/apache/datafusion/commit/6241218359dc2e6df9c5cd35b7fda03f19cbfdbe?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/datafusion/pull/24781?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [datafusion/pruning/src/pruning\_predicate.rs](https://app.codecov.io/gh/apache/datafusion/pull/24781?src=pr&el=tree&filepath=datafusion%2Fpruning%2Fsrc%2Fpruning_predicate.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9wcnVuaW5nL3NyYy9wcnVuaW5nX3ByZWRpY2F0ZS5ycw==) | 90.00% | [7 Missing and 11 partials :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/24781?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [datafusion/pruning/src/string\_in\_list.rs](https://app.codecov.io/gh/apache/datafusion/pull/24781?src=pr&el=tree&filepath=datafusion%2Fpruning%2Fsrc%2Fstring_in_list.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9wcnVuaW5nL3NyYy9zdHJpbmdfaW5fbGlzdC5ycw==) | 80.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/24781?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #24781 +/- ##
==========================================
- Coverage 81.53% 81.53% -0.01%
==========================================
Files 1123 1123
Lines 406041 406218 +177
Branches 406041 406218 +177
==========================================
+ Hits 331049 331192 +143
- Misses 55631 55652 +21
- Partials 19361 19374 +13
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/24781?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on code in PR #24781:
URL: https://github.com/apache/datafusion/pull/24781#discussion_r3912481994
##########
datafusion/pruning/src/string_in_list.rs:
##########
@@ -151,19 +184,46 @@ impl PhysicalExpr for StringInListPruningExpr {
// uses actual Arrow partition values. PrunableStatistics
// trusts file providers' bounds: there is no ordering gate
// for arbitrary statistics providers here.
- let index = self.values.partition_point(|v| v.as_bytes() < min);
- Some(self.values.get(index).is_some_and(|v| v.as_bytes() <= max))
+ match self.membership {
+ SetMembership::In => {
+ let index =
+ self.values.partition_point(|v| v.as_bytes() < min);
+ Some(
+ self.values
+ .get(index)
+ .is_some_and(|v| v.as_bytes() <= max),
+ )
+ }
+ // A wider interval can always hold a value outside the
+ // domain, which satisfies NOT IN. Only an interval
+ // pinned to one domain value rules out every row.
+ // Truncated Parquet bounds cannot fake that: min
+ // truncates downward and max upward, so equal bounds
Review Comment:
Could we add an end-to-end `NOT IN` case with deliberately truncated Parquet statistics or page-index bounds? This arm relies on truncation producing a lower min and upper max. The current integration coverage uses exact short strings, while the unit test uses synthetic bounds. A small writer setup with a short truncate length would help lock in the conservative behavior and ensure we never incorrectly prune in this case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: use compact pruning for large string NOT IN lists [datafusion]
Posted by "adriangb (via GitHub)" <gi...@apache.org>.
adriangb commented on PR #24781:
URL: https://github.com/apache/datafusion/pull/24781#issuecomment-5542585241
Amazing to see this ready, thank you both!!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org