Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20171#discussion_r161385548
--- Diff: python/pyspark/sql/tests.py ---
@@ -380,10 +380,16 @@ def test_udf2(self):
def test_udf3(self):
twoargs = self.spark.catalog.registerFunction(
- "twoArgs", UserDefinedFunction(lambda x, y: len(x) + y),
IntegerType())
+ "twoArgs", UserDefinedFunction(lambda x, y: len(x) + y))
self.assertEqual(twoargs.deterministic, True)
[row] = self.spark.sql("SELECT twoArgs('test', 1)").collect()
- self.assertEqual(row[0], 5)
+ self.assertEqual(row[0], u'5')
+
+ def test_udf_using_registerFunction_incompatibleTypes(self):
--- End diff --
How about `test_udf_registration_return_type_mismatch`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]