You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Ivan Jevtic (Jira)" <ji...@apache.org> on 2024/09/20 16:53:00 UTC

[jira] [Commented] (SPARK-49739) NPE from org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions.$anonfun$asProperties$1

    [ https://issues.apache.org/jira/browse/SPARK-49739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17883349#comment-17883349 ] 

Ivan Jevtic commented on SPARK-49739:
-------------------------------------

I created a pr which solves this: https://github.com/apache/spark/pull/48188.

> NPE from org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions.$anonfun$asProperties$1
> --------------------------------------------------------------------------------------------
>
>                 Key: SPARK-49739
>                 URL: https://issues.apache.org/jira/browse/SPARK-49739
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.5.2, 3.4.3
>            Reporter: Ivan Jevtic
>            Priority: Minor
>              Labels: pull-request-available
>
> NullPointerException occurs in the following stacktrace:
> {code:java}
> java.lang.NullPointerException
> 	at java.util.Hashtable.put(Hashtable.java:460)
> 	at java.util.Properties.setProperty(Properties.java:166)
> 	at org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions.$anonfun$asProperties$1(JDBCOptions.scala:55)
> 	at scala.collection.immutable.Map$Map2.foreach(Map.scala:273)
> 	at org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions.<init>(JDBCOptions.scala:55)
> 	at org.apache.spark.sql.execution.datasources.jdbc.JdbcOptionsInWrite.<init>(JDBCOptions.scala:258)
> 	at org.apache.spark.sql.execution.datasources.jdbc.JdbcOptionsInWrite.<init>(JDBCOptions.scala:262)
> 	at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.saveTableToJDBC(JdbcRelationProvider.scala:54)
> 	at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:101)
> 	at org.apache.spark.sql.execution.datasources.SaveIntoDataSourceCommand.run(SaveIntoDataSourceCommand.scala:50)
> 	at org.apache.spark.sql.execution.command.ExecutedCommandExec.$anonfun$sideEffectResult$2(commands.scala:84)
> 	at org.apache.spark.sql.execution.SparkPlan.runCommandWithAetherOff(SparkPlan.scala:180)
> 	at org.apache.spark.sql.execution.SparkPlan.runCommandInAetherOrSpark(SparkPlan.scala:191)
> 	at org.apache.spark.sql.execution.command.ExecutedCommandExec.$anonfun$sideEffectResult$1(commands.scala:84) {code}
> This occurs because [here,|https://github.com/apache/spark/blob/branch-3.5/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommand.scala#L46] the client sends invalid options, where some value in the map is null. We should return appropriate error condition here.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org