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

    https://github.com/apache/spark/pull/23104#discussion_r236115582
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -459,6 +459,7 @@ object LimitPushDown extends Rule[LogicalPlan] {
           val newJoin = joinType match {
             case RightOuter => join.copy(right = maybePushLocalLimit(exp, 
right))
             case LeftOuter => join.copy(left = maybePushLocalLimit(exp, left))
    +        case Cross => join.copy(left = maybePushLocalLimit(exp, left), 
right = maybePushLocalLimit(exp, right))
    --- End diff --
    
    A = {(a, 0), (b, 1), (c, 2), (d, 0), **(e, 1), (f, 2)**}
    B = {**(e, 1), (f, 2)**}
    
    A inner join B limit 2
    If there is limit 2, (a, 0), (b, 1) inner join {(e, 1), (f, 2)}, the result 
is empty. But the real result is not empty.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to