Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/5061#discussion_r26916328
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
@@ -212,6 +212,22 @@ class SQLContext(@transient val sparkContext:
SparkContext)
val udf: UDFRegistration = new UDFRegistration(this)
/**
+ * Call an user-defined function which is registered
+ * in functionRegistry.
+ * Example:
+ * {{{
+ * import org.apache.spark.sql._
+ *
+ * val df = Seq(("id1", 1), ("id2", 4), ("id3", 5)).toDF("id", "value")
+ * val sqlctx = df.sqlContext
+ * sqlctx.udf.register("simpleUdf", (v: Int) => v * v)
+ * df.select($"id", sqlctx.callUdf("simpleUdf", $"value"))
+ * }}}
+ */
+ def callUdf(udfName: String, cols: Column*): Column =
--- End diff --
> This probably belongs in functions.scala with the other callUDF methods.
This is still defined in the wrong file.
---
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]