GitHub user gatorsmile opened a pull request:
https://github.com/apache/spark/pull/17635
[SPARK-20335] [SQL] Children expressions of Hive UDF impacts the
determinism of Hive UDF
### What changes were proposed in this pull request?
```JAVA
/**
* Certain optimizations should not be applied if UDF is not
deterministic.
* Deterministic UDF returns same result each time it is invoked with a
* particular input. This determinism just needs to hold within the
context of
* a query.
*
* @return true if the UDF is deterministic
*/
boolean deterministic() default true;
```
Based on the definition of
[UDFType](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFType.java#L42-L50),
when Hive UDF's children are non-deterministic, Hive UDF is also
non-deterministic.
### How was this patch tested?
Added test cases.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gatorsmile/spark udfDeterministic
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17635.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #17635
----
commit 5cb42068da7ea0a6c6ff6728c168af17d1d02877
Author: Xiao Li <[email protected]>
Date: 2017-04-14T05:10:20Z
fix.
----
---
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]