HyukjinKwon commented on code in PR #46955:
URL: https://github.com/apache/spark/pull/46955#discussion_r1642609001
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala:
##########
@@ -52,7 +52,14 @@ class JDBCOptions(
*/
val asProperties: Properties = {
val properties = new Properties()
- parameters.originalMap.foreach { case (k, v) => properties.setProperty(k,
v) }
+ parameters.originalMap.foreach { case (k, v) =>
+ // If an option value is `null`, throw a user-friendly error. Keys here
cannot be null, as
+ // scala's implementation of Maps prohibits null keys.
+ if (v == null) {
+ throw QueryCompilationErrors.nullArgumentError("JDBC Options", k)
Review Comment:
The problem is that we throw an exception with `None`, then now it's a
breaking change. That's why I have been hesitant about doing this
incrementally, e.g., https://github.com/apache/spark/pull/46626
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]