Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/17848#discussion_r128141710
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala ---
@@ -104,21 +104,35 @@ class UDFRegistration private[sql] (functionRegistry:
FunctionRegistry) extends
val inputTypes = (1 to x).foldRight("Nil")((i, s) =>
{s"ScalaReflection.schemaFor[A$i].dataType :: $s"})
println(s"""
/**
- * Register a Scala closure of ${x} arguments as user-defined
function (UDF).
+ * Registers a Scala closure of ${x} arguments as user-defined
function (UDF).
* @tparam RT return type of UDF.
* @since 1.3.0
*/
def register[$typeTags](name: String, func: Function$x[$types]):
UserDefinedFunction = {
+ registerUDF(name, func, deterministic = true)
+ }
+
+ /**
+ * Registers a non-deterministic Scala closure of ${x} arguments
as user-defined function (UDF).
+ * @tparam RT return type of UDF.
+ * @since 2.3.0
+ */
+ def registerNonDeterministic[$typeTags](name: String, func:
Function$x[$types]): UserDefinedFunction = {
+ registerUDF(name, func, deterministic = false)
+ }
+
+ private def registerUDF[$typeTags](name: String, func:
Function$x[$types], deterministic: Boolean): UserDefinedFunction = {
--- End diff --
can we make this public?
---
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]