Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16954#discussion_r102168672
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -1110,31 +1184,24 @@ class Analyzer(
         }
     
         /**
    -     * Pull out all (outer) correlated predicates from a given subquery. 
This method removes the
    -     * correlated predicates from subquery [[Filter]]s and adds the 
references of these predicates
    -     * to all intermediate [[Project]] and [[Aggregate]] clauses (if they 
are missing) in order to
    -     * be able to evaluate the predicates at the top level.
    -     *
    -     * This method returns the rewritten subquery and correlated 
predicates.
    +     * Validates to make sure the outer references appearing inside the 
subquery
    +     * are legal. This function also returns the list of expressions
    +     * that contain outer references. These outer references would be kept 
as children
    +     * of subquery expressions by the caller of this function.
          */
    -    private def pullOutCorrelatedPredicates(sub: LogicalPlan): 
(LogicalPlan, Seq[Expression]) = {
    -      val predicateMap = scala.collection.mutable.Map.empty[LogicalPlan, 
Seq[Expression]]
    +    private def checkAndGetOuterReferences(sub: LogicalPlan): 
Seq[Expression] = {
    +      val outerReferences = 
scala.collection.mutable.ArrayBuffer.empty[Seq[Expression]]
    --- End diff --
    
    Nit: `ArrayBuffer.empty[Seq[Expression]]` should also work. Why is it 
useful to collect sequences of expressions instead of just expressions?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to