Github user icexelloss commented on a diff in the pull request: https://github.com/apache/spark/pull/20217#discussion_r160983255 --- Diff: python/pyspark/sql/context.py --- @@ -203,18 +203,46 @@ def registerFunction(self, name, f, returnType=StringType()): >>> _ = sqlContext.udf.register("stringLengthInt", lambda x: len(x), IntegerType()) >>> sqlContext.sql("SELECT stringLengthInt('test')").collect() [Row(stringLengthInt(test)=4)] + """ + return self.sparkSession.catalog.registerFunction(name, f, returnType) + + @ignore_unicode_prefix + @since(2.3) + def registerUDF(self, name, f): --- End diff -- I am not sure about the difference between: `spark.udf.registerUDF` `sqlContext.udf.registerUDF` and `sqlContext.registerUDF` Seems too many ways to do the same thing...But if we indeed need to keep multiple methods, I would lean towards having comprehensive doc in one of them and have the doc for the rest to be something like """ Same as :meth:... """
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org