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

    https://github.com/apache/spark/pull/21109#discussion_r188251314
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala
 ---
    @@ -131,13 +134,101 @@ object ExtractEquiJoinKeys extends Logging with 
PredicateHelper {
     
           if (joinKeys.nonEmpty) {
             val (leftKeys, rightKeys) = joinKeys.unzip
    -        logDebug(s"leftKeys:$leftKeys | rightKeys:$rightKeys")
    -        Some((joinType, leftKeys, rightKeys, 
otherPredicates.reduceOption(And), left, right))
    +
    +        // Find any simple range expressions between two columns
    +        // (and involving only those two columns)
    +        // of the two tables being joined,
    +        // which are not used in the equijoin expressions,
    +        // and which can be used for secondary sort optimizations.
    +        val rangePreds: mutable.Set[Expression] = mutable.Set.empty
    --- End diff --
    
    We need to separate range conditions that are relevant for the 
optimizations from other join conditions. `rangePreds` is used later to remove 
range predicates from "other predicates" (if any). 


---

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

Reply via email to