uros-b commented on code in PR #59591:
URL: https://github.com/apache/spark/pull/59591#discussion_r4316114818


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/AsOfJoinResolver.scala:
##########
@@ -140,6 +141,22 @@ class AsOfJoinResolver(
     }
   }
 
+  /**
+   * Merges the ID mappings of both sides. It also keeps the IDs of hidden 
columns like `d.k`:
+   * `MATCH_CONDITION` is resolved again later, and a copy of the same table 
on the other side
+   * must not remap them.
+   */
+  private def mergeChildMappings(leftNameScope: NameScope, rightNameScope: 
NameScope): Unit = {

Review Comment:
   The same JoinResolver merge also means a regular
   
   ```
   SELECT d.k, x.k
   FROM (using_right r LEFT JOIN using_keys d USING (k))
   JOIN using_keys x ON d.k = x.k
   ```
   
   can plan x.k = x.k.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/resolver/AsOfJoinResolver.scala:
##########
@@ -140,6 +141,22 @@ class AsOfJoinResolver(
     }
   }
 
+  /**
+   * Merges the ID mappings of both sides. It also keeps the IDs of hidden 
columns like `d.k`:
+   * `MATCH_CONDITION` is resolved again later, and a copy of the same table 
on the other side
+   * must not remap them.
+   */
+  private def mergeChildMappings(leftNameScope: NameScope, rightNameScope: 
NameScope): Unit = {

Review Comment:
   You extracted this helper so it can be reused. Please call it from 
JoinResolver (JoinLikeResolver is the right home). Or scope this PR to direct 
children and file a follow-up JIRA for the JoinResolver half — I would rather 
fix it here.



-- 
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]

Reply via email to