yaooqinn edited a comment on pull request #28106:
URL: https://github.com/apache/spark/pull/28106#issuecomment-625648533
I see the concerns.
The behavior of `try` here is simply that it wraps a `try-catch` for its
root child expression. And the meanings of `try` will be spread based on how
the child expression tree to be executed.
For scalar functions, the meaning would change because the underlying logic
can be folded inside the same `try-catch` block. `TRY(a / TRY(MyUDF(b)))` and
`TRY(a / MyUDF(b))` are same.
There is no such propagating errors or NULLs thing for aggregates and
subqueries as you mentioned, the `try` will stay on the top of its root child
and takes no effects. In other words, it does not work for aggregates and
subqueries.
`TRY(SUM(a/b))` and `TRY(a IN (SELECT ... WHERE a/b > 1))` can not swallow
`divide by zero` error.
In `TRY(SUM(TRY(a/b)))`, only the second `try` supress runtime errors.
Maybe we can and a checker and forbid `try` to be used for aggregates and
subqueries explicitly. then there would be no ambiguity
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]