Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/20908#discussion_r177296271
--- Diff: python/pyspark/sql/tests.py ---
@@ -3966,6 +3967,15 @@ def random_udf(v):
random_udf = random_udf.asNondeterministic()
return random_udf
+ def test_pandas_udf_tokenize(self):
+ from pyspark.sql.functions import pandas_udf
+ tokenize = pandas_udf(lambda s: s.apply(lambda str: str.split('
')),
+ ArrayType(StringType()))
+ self.assertEqual(udf.returnType, ArrayType(StringType()))
+ df = self.spark.createDataFrame([("hi boo",), ("bye boo",)],
["vals"])
+ result = df.select(tokenize("vals").alias("hi"))
+ self.assertEqual([], result.collect())
--- End diff --
Am I missing something? Is it equal to `[]`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]