aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJeff Zhang <zjffdu@apache.org>2015-11-25 13:49:58 +0000
committerSean Owen <sowen@cloudera.com>2015-11-25 13:49:58 +0000
commitb9b6fbe89b6d1a890faa02c1a53bb670a6255362 (patch)
treee3a06f154faaee4f71d6bb81948865e2e7aa6278 /python
parent63850026576b3ea7783f9d4b975171dc3cff6e4c (diff)
downloadspark-b9b6fbe89b6d1a890faa02c1a53bb670a6255362.tar.gz
spark-b9b6fbe89b6d1a890faa02c1a53bb670a6255362.tar.bz2
spark-b9b6fbe89b6d1a890faa02c1a53bb670a6255362.zip
[SPARK-11860][PYSAPRK][DOCUMENTATION] Invalid argument specification …
…for registerFunction [Python] Straightforward change on the python doc Author: Jeff Zhang <zjffdu@apache.org> Closes #9901 from zjffdu/SPARK-11860.
Diffstat (limited to 'python')
-rw-r--r--python/pyspark/sql/context.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/pyspark/sql/context.py b/python/pyspark/sql/context.py
index 5a85ac3102..a49c1b58d0 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))