allisonwang-db commented on code in PR #46955:
URL: https://github.com/apache/spark/pull/46955#discussion_r1640211300
##########
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:
Yeah, I think we should create a new error class for cases where the data
source options value is null. This could be used by other data sources as well.
--
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]