aokolnychyi commented on code in PR #54492:
URL: https://github.com/apache/spark/pull/54492#discussion_r2855254535
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteMergeIntoTable.scala:
##########
@@ -237,19 +237,21 @@ object RewriteMergeIntoTable extends
RewriteRowLevelCommand with PredicateHelper
}
// converts a MERGE condition into an EXISTS subquery for runtime filtering
- private def toGroupFilterCondition(
+ private def buildGroupFilterCondition(
relation: DataSourceV2Relation,
source: LogicalPlan,
- cond: Expression): Expression = {
+ cond: Expression): Option[Expression] = {
- val condWithOuterRefs = cond transformUp {
- case attr: Attribute if relation.outputSet.contains(attr) =>
OuterReference(attr)
- case other => other
- }
- val outerRefs = condWithOuterRefs.collect {
- case OuterReference(e) => e
+ Option.when(groupFilterEnabled) {
+ val condWithOuterRefs = cond transformUp {
Review Comment:
This logic is simply moved inside this branch. I can use an explicit early
return to minimize changes but I am not sure how everyone feels about explicit
returns in Scala.
--
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]