amaliujia commented on code in PR #46955:
URL: https://github.com/apache/spark/pull/46955#discussion_r1638999946
##########
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:
I don't feel that you use the right error:
```
"INVALID_PARAMETER_VALUE" : {
"message" : [
"The value of parameter(s) <parameter> in <functionName> is invalid:"
],
```
--
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]