Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/7535#issuecomment-122987493
I discussed with @marmbrus on this. Here's the suggestion:
1. Get rid of Initializable trait, and move initialize into Expression
itself, mark it final. Its implementation recursively initialize children, and
then calls an internal version for the expression to initialize itself. Mark an
initialized flag as true after that.
2. Add a check in various implementations of nullSafeEval to fail if
initialized is false; this helps us catch problems.
3. A few places we are using Cast expression to do proper casting. Consider
moving those out of cast into a cast util class, and call those directly
instead since they should be stateless. (Are they always stateless? Are
timestamp/etc rely on Calendar?)
---
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]