You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/06/12 10:50:43 UTC
[GitHub] [spark] maropu commented on a change in pull request #28810: [SPARK-31705][SQL][FOLLOWUP] Avoid the unnecessary CNF computation for full-outer joins
maropu commented on a change in pull request #28810:
URL: https://github.com/apache/spark/pull/28810#discussion_r439347664
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1334,13 +1340,13 @@ object PushPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelper {
(rightFilterConditions ++ commonFilterCondition).
reduceLeftOption(And).map(Filter(_, newJoin)).getOrElse(newJoin)
- case FullOuter => f // DO Nothing for Full Outer Join
- case NaturalJoin(_) => sys.error("Untransformed NaturalJoin node")
- case UsingJoin(_, _) => sys.error("Untransformed Using join node")
+
+ case jt =>
+ sys.error(s"Unexpected join type: $jt")
Review comment:
How about `IllegalStateException`? Throwing an exception here looks okay to me, but I personally think we need consistent handling for unexpected code pathes. I've checed how to handle this unexpected behaivour in the other optimzier rules, then I found there are some rules to use `sys.error`;
```
$ grep -nr "sys.error" .
./Optimizer.scala:1345: sys.error(s"Unexpected join type: $jt")
./Optimizer.scala:1381: sys.error(s"Unexpected join type: $jt")
./PushCNFPredicateThroughJoin.scala:64: sys.error(s"Unexpected join type: $jt")
./subquery.scala:458: sys.error(s"Unexpected operator in scalar subquery: $lp")
./subquery.scala:496: sys.error(s"Correlated subquery has unexpected operator $op below filter")
./subquery.scala:498: case op @ _ => sys.error(s"Unexpected operator $op in correlated subquery")
./subquery.scala:502: sys.error("This line should be unreachable")
./subquery.scala:564: case op => sys.error(s"Unexpected operator $op in corelated subquery")
```
Is it better to change them, too?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org