Github user cloud-fan commented on the pull request:

    https://github.com/apache/spark/pull/7157#issuecomment-118359398
  
    hi @chenghao-intel , thanks for looking into this! I agree with your 
opinions, but have some other thoughts:
    * In this PR I added a new `nullSafeEval` for binary and unary expressions, 
with a default implementation: throw exception. So if new developers don't know 
this, it's OK for them to just override `eval` with some duplicated code. For 
someone is familiar with expression framework, they can use this shortcut to 
save code.
    * For exceptional cases, developers can still override `eval` and no need 
to care about `nullSafeEval`.
    * Duplicated code is not a big deal, but this pattern is so common and I 
think it's good to abstract it.



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to