[
https://issues.apache.org/jira/browse/SPARK-24165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wenchen Fan resolved SPARK-24165.
---------------------------------
Resolution: Fixed
Fix Version/s: 2.4.0
Issue resolved by pull request 21687
[https://github.com/apache/spark/pull/21687]
> UDF within when().otherwise() raises NullPointerException
> ---------------------------------------------------------
>
> Key: SPARK-24165
> URL: https://issues.apache.org/jira/browse/SPARK-24165
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.2.0
> Reporter: Jingxuan Wang
> Assignee: Marek Novotny
> Priority: Major
> Fix For: 2.4.0
>
>
> I have a UDF which takes java.sql.Timestamp and String as input column type
> and returns an Array of (Seq[case class], Double) as output. Since some of
> values in input columns can be nullable, I put the UDF inside a
> when($input.isNull, null).otherwise(UDF) filter. Such function works well
> when I test in spark shell. But running as a scala jar in spark-submit with
> yarn cluster mode, it raised NullPointerException which points to the UDF
> function. If I remove the when().otherwsie() condition, but put null check
> inside the UDF, the function works without issue in spark-submit.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]