wangyum opened a new pull request, #40791:
URL: https://github.com/apache/spark/pull/40791

   ### What changes were proposed in this pull request?
   
   This PR makes `DummyLeafNode` override computeStats.
   
   ### Why are the changes needed?
   
   To avoid `UnsupportedOperationException` if we add a rule(for example: the 
following `TestRule`) use statistics even the rule after the [Early Filter and 
Projection 
Push-Down](https://github.com/apache/spark/blob/0e9e34c1bd9bd16ad5efca77ce2763eb950f3103/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala#L194-L197).
   ```scala
   object TestRule extends Rule[LogicalPlan] {
     def apply(plan: LogicalPlan): LogicalPlan = plan.transform {
       case f: Filter if f.stats.rowCount.nonEmpty =>
         f
     }
   }
   ```
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Manual test.
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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