You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (JIRA)" <ji...@apache.org> on 2019/07/27 02:40:00 UTC
[jira] [Resolved] (SPARK-28441) PythonUDF used in correlated scalar
subquery causes UnsupportedOperationException
[ https://issues.apache.org/jira/browse/SPARK-28441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan resolved SPARK-28441.
---------------------------------
Resolution: Fixed
Fix Version/s: 3.0.0
Issue resolved by pull request 25204
[https://github.com/apache/spark/pull/25204]
> PythonUDF used in correlated scalar subquery causes UnsupportedOperationException
> ----------------------------------------------------------------------------------
>
> Key: SPARK-28441
> URL: https://issues.apache.org/jira/browse/SPARK-28441
> Project: Spark
> Issue Type: Bug
> Components: PySpark, SQL
> Affects Versions: 3.0.0
> Reporter: Huaxin Gao
> Priority: Major
> Fix For: 3.0.0
>
>
> I found this when doing https://issues.apache.org/jira/browse/SPARK-28277
>
> {code:java}
> >>> @pandas_udf("string", PandasUDFType.SCALAR)
> ... def noop(x):
> ... return x.apply(str)
> ...
> >>> spark.udf.register("udf", noop)
> <function noop at 0x111b5f9d8>
> >>> spark.sql("CREATE OR REPLACE TEMPORARY VIEW t1 as select * from values (\"one\", 1), (\"two\", 2),(\"three\", 3),(\"one\", NULL) as t1(k, v)")
> DataFrame[]
> >>> spark.sql("CREATE OR REPLACE TEMPORARY VIEW t2 as select * from values (\"one\", 1), (\"two\", 22),(\"one\", 5),(\"one\", NULL), (NULL, 5) as t2(k, v)")
> DataFrame[]
> >>> spark.sql("SELECT t1.k FROM t1 WHERE t1.v <= (SELECT udf(max(udf(t2.v))) FROM t2 WHERE udf(t2.k) = udf(t1.k))").show()
> py4j.protocol.Py4JJavaError: An error occurred while calling o65.showString.
> : java.lang.UnsupportedOperationException: Cannot evaluate expression: udf(null)
> at org.apache.spark.sql.catalyst.expressions.Unevaluable.eval(Expression.scala:296)
> at org.apache.spark.sql.catalyst.expressions.Unevaluable.eval$(Expression.scala:295)
> at org.apache.spark.sql.catalyst.expressions.PythonUDF.eval(PythonUDF.scala:52)
> {code}
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org