Skip to content

Conversation

@gatorsmile
Copy link
Member

What changes were proposed in this pull request?

This PR is to backport #17635 to Spark 2.1


  /**
   * 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, when Hive UDF's children are non-deterministic, Hive UDF is also non-deterministic.

How was this patch tested?

Added test cases.

@SparkQA
Copy link

SparkQA commented Apr 16, 2017

Test build #75842 has finished for PR 17652 at commit 68d1e4d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

asfgit pushed a commit that referenced this pull request Apr 17, 2017
…acts the determinism of Hive UDF

### What changes were proposed in this pull request?

This PR is to backport #17635 to Spark 2.1

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

Author: Xiao Li <[email protected]>

Closes #17652 from gatorsmile/backport-17635.
@cloud-fan
Copy link
Contributor

thanks, merging to 2.1!

@gatorsmile gatorsmile closed this Apr 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants