Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/15807
  
    If we only evaluate the subexpressions before they are used. Wouldn't it 
cause more than once evaluation?
    
    E.g.,
    
        if (isNull(subexpr)) {
          ...
        } else {
          AssertNotNull(subexpr)  // subexpr2
          ....
          SomeExpr(AssertNotNull(subexpr)) // SomeExpr(subexpr2)
        }
    
        if (isNull(subexpr)) {
          ...
        } else {
          AssertNotNull(subexpr)  // subexpr2
          ....
          SomeExpr2(AssertNotNull(subexpr)) // SomeExpr2(subexpr2)
        }   
    
        SomeExpr3(AssertNotNull(subexpr)) // SomeExpr3(subexpr2)
       
    If we evaluate `subexpr2` before it is used, we might evaluate it three 
times at the end.
    



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

Reply via email to