Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20171#discussion_r161385554
--- Diff: python/pyspark/sql/tests.py ---
@@ -3616,6 +3622,21 @@ def test_vectorized_udf_basic(self):
bool_f(col('bool')))
self.assertEquals(df.collect(), res.collect())
+ def test_register_nondeterministic_vectorized_udf_basic(self):
+ from pyspark.sql.functions import pandas_udf
+ from pyspark.rdd import PythonEvalType
+ import random
+ randomPandasUDF = pandas_udf(
+ lambda x: random.randint(6, 6) + x,
IntegerType()).asNondeterministic()
+ self.assertEqual(randomPandasUDF.deterministic, False)
+ self.assertEqual(randomPandasUDF.evalType,
PythonEvalType.SQL_PANDAS_SCALAR_UDF)
+ nondeterministicPandasUDF = self.spark.catalog.registerFunction(
--- End diff --
`nondeterministicPandasUDF` -> `nondeterministic_pandas_udf`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]