dongjoon-hyun commented on code in PR #47646:
URL: https://github.com/apache/spark/pull/47646#discussion_r1714335686
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala:
##########
@@ -283,6 +283,14 @@ class JdbcOptionsInWrite(
}
object JDBCOptions {
+
+ /**
+ * Load DriverManager first to avoid any race condition between
+ * DriverManager static initialization block and specific driver class's
+ * static initialization block. e.g. com.mysql.jdbc.Driver
+ */
+ DriverManager.getDrivers
Review Comment:
Well, let's be fair not to mention `com.mysql.jdbc.Driver` here because we
don't receive any report from it.
In addition, `JDBCOptions` already invokes `DriverManager` here.
https://github.com/apache/spark/blob/111302991006e6456de5a145549dec10ae7e49ae/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala#L110-L120
Given that, the key goal of this PR is moving the initialization from
`JDBCOptions class initialization` to `JDBC object initialization` technically?
> I went through the JDBC-related code, object JDBCOptions should be a
better place than object DriverRegistry
--
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]