Skip to content

Commit 4971eaa

Browse files
zjffdusrowen
authored andcommitted
[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. (cherry picked from commit b9b6fbe) Signed-off-by: Sean Owen <sowen@cloudera.com>
1 parent a986a3b commit 4971eaa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/pyspark/sql/context.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,15 @@ def range(self, start, end=None, step=1, numPartitions=None):
195195
@ignore_unicode_prefix
196196
@since(1.2)
197197
def registerFunction(self, name, f, returnType=StringType()):
198-
"""Registers a lambda function as a UDF so it can be used in SQL statements.
198+
"""Registers a python function (including lambda function) as a UDF
199+
so it can be used in SQL statements.
199200
200201
In addition to a name and the function itself, the return type can be optionally specified.
201202
When the return type is not given it default to a string and conversion will automatically
202203
be done. For any other return type, the produced object must match the specified type.
203204
204205
:param name: name of the UDF
205-
:param samplingRatio: lambda function
206+
:param f: python function
206207
:param returnType: a :class:`DataType` object
207208
208209
>>> sqlContext.registerFunction("stringLengthString", lambda x: len(x))

0 commit comments

Comments
 (0)