anton5798 commented on code in PR #55477:
URL: https://github.com/apache/spark/pull/55477#discussion_r3129476391
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala:
##########
@@ -808,9 +808,12 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan]
with PredicateHelper {
}
// Remap pushed filter attributes to the pruned output schema and drop
filters
- // whose references are no longer in the pruned output.
- val remappedPushedFilters =
sHolder.pushedFilterExpressions.map(projectionFunc)
- .filter(_.references.subsetOf(AttributeSet(output)))
+ // whose references are no longer in the pruned output. Use Try because
+ // ProjectionOverSchema throws when a pushed filter references a nested
struct
+ // field that was pruned from the schema.
+ val remappedPushedFilters = sHolder.pushedFilterExpressions.flatMap {
filter =>
+ scala.util.Try(projectionFunc(filter)).toOption
+ }.filter(_.references.subsetOf(AttributeSet(output)))
Review Comment:
Done, thanks!
--
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]