cloud-fan commented on a change in pull request #32602:
URL: https://github.com/apache/spark/pull/32602#discussion_r635821206



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/EliminateUnnecessaryJoin.scala
##########
@@ -59,19 +66,33 @@ object EliminateUnnecessaryJoin extends Rule[LogicalPlan] {
         case Some(count) => hasRow == (count > 0)
         case _ => false
       }
+
+    case LocalRelation(_, data, isStreaming) if !isStreaming =>

Review comment:
       Since AQE is on by default, it's not a big issue but more about code 
cleanness. How about this:
   1. `EliminateUnnecessaryJoin` should only deal with `LocalRelation`, and 
appears in both the normal optimizer and AQE optimizer
   2. AQE optimizer adds a new rule to turn empty query stage into empty 
`LocalRelation`




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to