Repository navigation
Conversation
Port the native predicate from apache/datafusion-comet#6180 for direct construction by downstream engines. Refs apache#27075.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Closes #27075. Related to #15914.
Rationale for this change
Port the native predicate from apache/datafusion-comet#6180 so downstream engines can reuse it for Spark's DataFrame.na.drop.
What changes are included in this PR?
Add SparkAtLeastNNonNullsExpr for direct construction from a fixed threshold and planned physical children. It returns a non-null Boolean, excludes NULL/NaN values, and stops evaluating a row's remaining children once the threshold is reached. Callers remain responsible for shared-subexpression hoisting.
The port includes the bitmap counting paths, correctness tests, a usage example and a 31-case Criterion benchmark.
What is the testing strategy for this PR?
cargo test --profile ci -p datafusion-spark: 332 unit tests and 4 doctests passed; 1 existing doctest ignored.extended_tests, recursive protection and Parquet encryption, excluding the CLI/examples/benchmarks: 13,487 Rust tests passed, 8 ignored; 547 SQLLogicTest files completed.release-nonltobenchmark cases completed with answer assertions. Two independent comparisons with reversed strategy order favored the bitmap counter in all 11 general-n column-input cases. These are expression-only measurements on an M3 Pro.Package tests, extended workspace tests and lint checks were run on base
ea33cce29. Benchmark comparisons used base181a87af6with the same feature diff. No end-to-end Spark benchmark was run.Are there any user-facing changes?
A new public Rust PhysicalExpr is available for direct construction. There is no Spark SQL function name for this internal Catalyst predicate.