[
https://issues.apache.org/jira/browse/SPARK-40121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17580714#comment-17580714
]
Apache Spark commented on SPARK-40121:
--------------------------------------
User 'HyukjinKwon' has created a pull request for this issue:
https://github.com/apache/spark/pull/37552
> Initialize projection used for Python UDF
> -----------------------------------------
>
> Key: SPARK-40121
> URL: https://issues.apache.org/jira/browse/SPARK-40121
> Project: Spark
> Issue Type: Bug
> Components: PySpark, SQL
> Affects Versions: 3.1.3, 3.3.0, 3.2.2, 3.4.0
> Reporter: Hyukjin Kwon
> Priority: Major
>
> {code}
> >>> from pyspark.sql.functions import udf, rand
> >>> spark.range(10).select(udf(lambda x: x)(rand())).show()
> {code}
> {code}
> java.lang.NullPointerException
> at
> org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificMutableProjection.apply(Unknown
> Source)
> at
> org.apache.spark.sql.execution.python.EvalPythonExec.$anonfun$doExecute$10(EvalPythonExec.scala:126)
> at scala.collection.Iterator$$anon$10.next(Iterator.scala:461)
> at scala.collection.Iterator$$anon$10.next(Iterator.scala:461)
> at
> scala.collection.Iterator$GroupedIterator.takeDestructively(Iterator.scala:1161)
> at scala.collection.Iterator$GroupedIterator.go(Iterator.scala:1176)
> at scala.collection.Iterator$GroupedIterator.fill(Iterator.scala:1213)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]