[SPARK-59068][4.3][SQL] Correct runtime filter attribute handling - #58412
[SPARK-59068][4.3][SQL] Correct runtime filter attribute handling#58412szehon-ho wants to merge 4 commits into
Conversation
|
@cloud-fan @dongjoon-hyun @sunchao @HeartSaVioR can you help review (this is minimal DSV2 API-facing backport for Spark 4.3 to prevent breaking change) |
sunchao
left a comment
There was a problem hiding this comment.
Rereviewed 51ee79a with five independent agents. The original Catalyst example is fixed and its regression test passed in CI. Two remaining findings are noted inline, both limited to the in-memory test connectors and established from source. No local Spark test suites or runtime reproductions were run.
|
Added the two follow-ups from cloud-fan's post-merge review of #58370:
The focused regression passes. |
|
hi @sunchao , can you take another look when you get a chance (for 4.3) ? Thanks! |
|
I reviewed this backport with a multi-agent review (8 finder angles, then a verification pass), cross-checking against Merge order / cross-branch sync1. [P2] The last commit pre-includes the still-open master follow-up #58439 ( 2. [P2] The fixture transform-semantics fixes have no master counterpart ( Production code (same code exists on master)3. [P2] A top-level struct root in 4. [P3] DPP and row-level paths bypass the new structured error ( Cleanup (same code exists on master; best fixed upstream, then re-backported)5. [P3] Generated-by: Claude Fable 5 |
|
Hi, @szehon-ho . It seems that we need to revisit |
|
Thanks for the detailed review. The merge-order concern is now resolved: #58439 landed in both master (6864fbb) and branch-4.x (91c3e7d). Both commits have the same patch ID as c845783 in this PR. The transform-semantics changes are limited to test fixtures. I propose handling their upstream synchronization separately rather than expanding this 4.3 backport. Items 3–8 likewise describe existing upstream behavior or cleanup and should be addressed upstream first if pursued. |
|
Follow-up review of c845783 against the latest Test fixtures (this PR)1. [P2] 2. [P3] The test name "transformed partition source cannot be declared fully pushed" implies a Spark-side guard that does not exist ( 3. [P3] 4. [P3] 5. [P3] ~40 unchanged lines re-indented in Interface docs (same text exists on master; best fixed upstream)6. [P3] Root-attribute eligibility is documented as a contract rather than current behavior ( |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
To prevent any accidental merging, I'm simply blocking this PR because we need to fix master branch first before this PR as @szehon-ho agreed here #58412 (comment) .
|
I opened #58503 as the It addresses the upstream items before this 4.3 backport proceeds:
The focused Catalyst, V1/V2 DPP, and both row-level implementations pass, along with compilation, error-condition validation, scalastyle, and checkstyle. Once #58503 lands in |
|
Thank you, @szehon-ho . Please address the review comments on that PR. |
|
Thank you, @szehon-ho . I approved the followup. Please make this PR up-to-date to make it consistent across branches. |
What changes were proposed in this pull request?
This PR backports the corrected runtime-filter attribute handling from #58370 to
branch-4.3.It:
filterAttributes()and preserves nested access in the pushed filter;fullyPushedFilterAttributes()limited to top-level attributes;This is a net backport. It adapts the final behavior to the 4.3 codebase without pulling in unrelated fixture refactoring from later branches.
Why are the changes needed?
branch-4.3contains the unreleasedSupportsRuntimeCatalystFilteringAPI, so this backport aligns its runtime-filter attribute behavior with the corrected implementation.Does this PR introduce any user-facing change?
Yes. Runtime-filtering scans may report nested references from ordinary
filterAttributes(). Nested references fromfullyPushedFilterAttributes()remain unsupported, and invalid fully-pushed attributes are rejected consistently during planning.For
SupportsRuntimeCatalystFiltering, this corrects behavior on the unreleased Spark 4.3 branch. Method signatures and binary compatibility are unchanged.How was this patch tested?
SPARK_GENERATE_GOLDEN_FILES=1 build/sbt 'core/testOnly *SparkThrowableSuite -- -t "Error conditions are correctly formatted"'build/sbt 'core/testOnly org.apache.spark.SparkThrowableSuite'build/sbt 'sql/testOnly org.apache.spark.sql.connector.DataSourceV2CatalystRuntimeFilterSuite'DataSourceV2SQLSuiteV1FilterandDataSourceV2SQLSuiteV2FilterGroupBasedRowLevelOperationCatalystRuntimeFilterSuiteDeltaBasedRowLevelOperationCatalystRuntimeFilterSuitecatalyst/scalastylesql/scalastylecatalyst/checkstylebuild/sbt 'sql/testOnly org.apache.spark.sql.connector.DataSourceV2CatalystRuntimeFilterSuite -- -z "missing fully pushed filter attribute"'Was this patch authored or co-authored using generative AI tooling?
Generated-by: Codex with GPT-5