Skip to content

Commit 3a62c32

Browse files
author
Davies Liu
committed
improve comments
1 parent 1a32fea commit 3a62c32

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object DefaultOptimizer extends Optimizer {
4242
// Operator push down
4343
SetOperationPushDown,
4444
SamplePushDown,
45-
ReorderInnerJoin,
45+
ReorderJoin,
4646
PushPredicateThroughJoin,
4747
PushPredicateThroughProject,
4848
PushPredicateThroughGenerate,
@@ -711,12 +711,13 @@ object PushPredicateThroughAggregate extends Rule[LogicalPlan] with PredicateHel
711711
}
712712

713713
/**
714-
* Reorder the inner joins so that the bottom ones have at least one condition.
715-
*
716-
* TODO: support outer joins
714+
* Reorder the joins so that the bottom ones have at least one condition.
717715
*/
718-
object ReorderInnerJoin extends Rule[LogicalPlan] with PredicateHelper {
716+
object ReorderJoin extends Rule[LogicalPlan] with PredicateHelper {
719717

718+
/**
719+
* Reorder the joins so that the bottom ones have at least one condition.
720+
*/
720721
def reorder(
721722
input: LogicalPlan,
722723
joins: Seq[LogicalPlan],
@@ -744,6 +745,7 @@ object ReorderInnerJoin extends Rule[LogicalPlan] with PredicateHelper {
744745
}
745746

746747
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
748+
// TODO: support outer join
747749
case FilterAndInnerJoins(input, joins, filterConditions) if joins.size > 1 =>
748750
assert(filterConditions.nonEmpty)
749751
val joined = reorder(input, joins, filterConditions)

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class FilterPushdownSuite extends PlanTest {
3838
CombineFilters,
3939
PushPredicateThroughProject,
4040
BooleanSimplification,
41-
ReorderInnerJoin,
41+
ReorderJoin,
4242
PushPredicateThroughJoin,
4343
PushPredicateThroughGenerate,
4444
PushPredicateThroughAggregate,

0 commit comments

Comments
 (0)