Github user aa8y commented on the pull request:

    https://github.com/apache/spark/pull/12587#issuecomment-213983438
  
    @hvanhovell The end use case for both `attempt` and `getOption` is to get 
values out of a row object without throwing an exception. However, in one of my 
previous PRs, #10247 (which didn't have an `attempt` method), it was pointed 
out by @marmbrus that the `getOption` method caught exceptions and converted 
them to `None`s. His PoV was that exceptions should not be caught as that hid 
important information. But since the whole reason of `getOption` was to *not* 
throw exceptions, I introduced the `attempt` method which returns `Success` and 
`Failure` objects, which do not lose information and `getOption`, which does 
and returns a `Some` or `None`.


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