Github user markhamstra commented on the pull request:
https://github.com/apache/spark/pull/6827#issuecomment-112254025
Yes, @jerryshao, the idiom is a little clearer when the contents of the
Option are actually be used to produce a result other than Unit, but it's also
a little odd to use a different idiom just to handle the Unit result type. A
lot of this is just style preference differences that often stem from how
familiar and comfortable a developer is with other functional programming
languages, libraries and idioms. And don't get me started on whether `fold`
over an Option is a better approach than `map getOrElse` -- we've already had
that discussion, and I lost :(.
Anyway, the upshot of this is that `map` with a Unit result looks weird to
some of us, unnecessary pattern matching over Option looks ugly to others of
us, and `Option#fold` is so offensive to some that I can't use it in Spark!
---
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]