Repository: spark Updated Branches: refs/heads/branch-1.6 a986a3bde -> 4971eaaa5
[SPARK-11860][PYSAPRK][DOCUMENTATION] Invalid argument specification ⦠â¦for registerFunction [Python] Straightforward change on the python doc Author: Jeff Zhang <zjf...@apache.org> Closes #9901 from zjffdu/SPARK-11860. (cherry picked from commit b9b6fbe89b6d1a890faa02c1a53bb670a6255362) Signed-off-by: Sean Owen <so...@cloudera.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/4971eaaa Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/4971eaaa Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/4971eaaa Branch: refs/heads/branch-1.6 Commit: 4971eaaa5768ad20c5a77278e435c97409a9ca8f Parents: a986a3b Author: Jeff Zhang <zjf...@apache.org> Authored: Wed Nov 25 13:49:58 2015 +0000 Committer: Sean Owen <so...@cloudera.com> Committed: Wed Nov 25 13:50:10 2015 +0000 ---------------------------------------------------------------------- python/pyspark/sql/context.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/4971eaaa/python/pyspark/sql/context.py ---------------------------------------------------------------------- diff --git a/python/pyspark/sql/context.py b/python/pyspark/sql/context.py index 5a85ac3..a49c1b5 100644 --- a/python/pyspark/sql/context.py +++ b/python/pyspark/sql/context.py @@ -195,14 +195,15 @@ class SQLContext(object): @ignore_unicode_prefix @since(1.2) def registerFunction(self, name, f, returnType=StringType()): - """Registers a lambda function as a UDF so it can be used in SQL statements. + """Registers a python function (including lambda function) as a UDF + so it can be used in SQL statements. In addition to a name and the function itself, the return type can be optionally specified. When the return type is not given it default to a string and conversion will automatically be done. For any other return type, the produced object must match the specified type. :param name: name of the UDF - :param samplingRatio: lambda function + :param f: python function :param returnType: a :class:`DataType` object >>> sqlContext.registerFunction("stringLengthString", lambda x: len(x)) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org