Github user sameeragarwal commented on a diff in the pull request: https://github.com/apache/spark/pull/15319#discussion_r84643784 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala --- @@ -74,20 +74,98 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT * additional constraint of the form `b = 5` */ private def inferAdditionalConstraints(constraints: Set[Expression]): Set[Expression] = { + // Collect alias from expressions to avoid producing non-converging set of constraints + // for recursive functions. + // + // Don't apply transform on constraints if the replacement will cause an recursive deduction, + // when that happens a non-converging set of constraints will be created and finally throw + // OOM Exception. + // For more details, refer to https://issues.apache.org/jira/browse/SPARK-17733 --- End diff -- This comment doesn't seem to give a lot of context about the underlying issue. How about we just add a top-level comment for this method summarizing the issue and remove this? Perhaps, something along the lines of the following: ```scala /** * Infers an additional set of constraints from a given set of equality constraints. * For e.g., if an operator has constraints of the form (`a = 5`, `a = b`), this returns an * additional constraint of the form `b = 5`. * * [SPARK-17733] We explicitly prevent producing recursive constraints of the form `a = f(a, b)` * as they are often useless and can lead to a non-converging set of constraints. */ private def inferAdditionalConstraints(constraints: Set[Expression]): Set[Expression] ```
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org