Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/22326#discussion_r220424663 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala --- @@ -1304,10 +1307,27 @@ object CheckCartesianProducts extends Rule[LogicalPlan] with PredicateHelper { } } + /** + * Check if a join contains PythonUDF in join condition. + */ + def hasPythonUDFInJoinCondition(join: Join): Boolean = { + val conditions = join.condition.map(splitConjunctivePredicates).getOrElse(Nil) + conditions.exists(HandlePythonUDFInJoinCondition.hasPythonUDF) + } + def apply(plan: LogicalPlan): LogicalPlan = if (SQLConf.get.crossJoinEnabled) { plan } else plan transform { + case j @ Join(_, _, _, _) if hasPythonUDFInJoinCondition(j) => --- End diff -- I don't get it. The error means we didn't pull out python udf, but we should already throw exception in `HandlePythonUDFInJoinCondition`
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org