Github user viirya commented on the issue:
https://github.com/apache/spark/pull/17626
`udf(x, y) = 1` is deterministic no matter whether x or y is deterministic
or not, is because x, y are not used, in other words they don't affect the
result of the udf.
The result of `udf(x, y) = x + y` is deterministic or not, depending on
whether x and y are deterministic too. The result of `udf(rand(), rand())` is
not deterministic, for example.
I think `ScalaUDAF` is a bit different to `ScalaUDF`, because we don't push
down an aggregate function. But we will push down a `ScalaUDF` if it is
deterministic. Pushing down it might cause unexpected results.
---
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]