Github user srinathshankar commented on a diff in the pull request:
https://github.com/apache/spark/pull/14866#discussion_r77219760
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -933,6 +936,47 @@ object CombineLimits extends Rule[LogicalPlan] {
}
/**
+ * Check if there any cartesian products between joins of any type in the
optimized plan tree.
+ * Throw an error if a cartesian product is found without an explicit
cross join specified.
+ * This rule is effectively disabled if the CROSS_JOINS_ENABLED flag is
true.
+ *
+ * This rule must be run AFTER the ReorderJoin rule since the join
conditions for each join must be
+ * collected before checking if it is a cartesian product. If you have
+ * SELECT * from R, S where R.r = S.s,
+ * the join between R and S is not a cartesian product and therefore
should be allowed.
+ * The predicate R.r = S.s is not recognized as a join condition until the
ReorderJoin rule.
+ */
+case class CheckCartesianProducts(conf: CatalystConf)
--- End diff --
As discussed, while it is probably best for this to be in analysis (does
throw an analysis exception after all), leaving it here until we want to
reorganize the analysis/optimizer rules.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]