Skip to content

Commit eb31c37

Browse files
author
Davies Liu
committed
update comments
1 parent 556a382 commit eb31c37

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,10 @@ object PushPredicateThroughAggregate extends Rule[LogicalPlan] with PredicateHel
711711
}
712712

713713
/**
714-
* Reorder the joins so that the bottom ones have at least one condition.
714+
* Reorder the joins and push all the conditions into join, so that the bottom ones have at least
715+
* one condition.
716+
*
717+
* The order of joins will not be changed if all of them already have at least one condition.
715718
*/
716719
object ReorderJoin extends Rule[LogicalPlan] with PredicateHelper {
717720

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,14 @@ object ExtractEquiJoinKeys extends Logging with PredicateHelper {
143143
* inner join
144144
* / \
145145
* plan0 plan1
146+
*
147+
* Note: This pattern currently only works for left-deep trees.
146148
*/
147149
object ExtractFiltersAndInnerJoins extends PredicateHelper {
148150

149151
// flatten all inner joins, which are next to each other
150152
def flattenJoin(plan: LogicalPlan): (Seq[LogicalPlan], Seq[Expression]) = plan match {
151153
case Join(left, right, Inner, cond) =>
152-
// only find the nested join on left, because we can only generate the plan like that
153154
val (plans, conditions) = flattenJoin(left)
154155
(plans ++ Seq(right), conditions ++ cond.toSeq)
155156

0 commit comments

Comments
 (0)