You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2017/01/31 19:31:33 UTC

[GitHub] spark pull request #14866: [SPARK-17298][SQL] Require explicit CROSS join fo...

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

    https://github.com/apache/spark/pull/14866#discussion_r98750834
  
    --- 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 --
    
    If we do it here, it does not cover all the cases, right? `Cartesian Product` might be chosen based on the statistics. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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