cloud-fan commented on code in PR #58370:
URL: https://github.com/apache/spark/pull/58370#discussion_r3882759160
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Relation.scala:
##########
@@ -223,21 +223,11 @@ case class DataSourceV2ScanRelation(
case s: SupportsRuntimeCatalystFiltering =>
s.fullyPushedFilterAttributes()
case _ => Array.empty[NamedReference]
}
- resolveTopLevelFilterAttrs(filterAttrs)
+ resolveFilterAttrs(filterAttrs)
Review Comment:
Nested paths resolved here are stored in an `AttributeSet`, which keeps only
their root `AttributeReference`. Advertising `derives.toStr` in
`fullyPushedFilterAttributes()` therefore also makes a scalar-subquery
predicate on `derives.other` pass the subset check in `DataSourceV2Strategy`;
Spark removes that predicate from `postScanFilters` even though the scan never
declared or evaluated the sibling path, so non-matching rows can be returned.
Please keep nested fully-pushed attributes rejected until eligibility preserves
complete field paths, and add exact-path and sibling-path regressions.
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala:
##########
@@ -5440,11 +5440,49 @@ class DataSourceV2SQLSuiteV1Filter
}
class DataSourceV2SQLSuiteV2Filter extends DataSourceV2SQLSuite {
Review Comment:
This regression only runs in `DataSourceV2SQLSuiteV2Filter`, but the
restored contract also changes `SupportsRuntimeFiltering`. That interface has a
distinct `Predicate[]` to `Filter[]` adapter and legacy scan callback, neither
of which is exercised here. Please make the legacy `InMemoryBatchScan` retain
resolvable nested partition references and run the equivalent pruning case in
the V1 suite so this public compatibility path is covered end to end.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]