Aggarwal-Raghav commented on PR #6116: URL: https://github.com/apache/hive/pull/6116#issuecomment-3386959982
> Explicitly loading a driver (using `Class.forName`) shouldn't be necessary in recent Java versions. Anyways, the code is there at the moment so probably this is outside of scope for the current PR. However, since the code wants to load a driver explicitly can we use `AutoloadedDriver` instead of the `EmbeddedDriver` by changing the appropriate Metastore conf? So I tried using AutoloadedDriver in my setup (without derbytools) and it is working nicely. I also replaced all the EmbeddedDriver with AutoloadedDriver in code as well and it's compiling/building well. I read about Service Provider Interface (SPI) and in (derby.jar) META-INF/services/java.sql.Driver contains `org.apache.derby.iapi.jdbc.AutoloadedDriver` and EmbeddedDriver is also using `AutoloadedDriver` internally. https://github.com/apache/derby/blob/4253dcf4aa37dc64cf7235d494cd2f00f72e678a/java/org.apache.derby.tools/org/apache/derby/jdbc/EmbeddedDriver.java#L184 So, i think we can do the following: 1. Remove derbytools from all pom.xml 2. Replace `org.apache.derby.jdbc.EmbeddedDriver` -> `org.apache.derby.iapi.jdbc.AutoloadedDriver` everywhere 3. Remove `Class.forName()` from `HiveSchemaHelper.java` Let me know your thoughts on this: https://github.com/Aggarwal-Raghav/hive/commit/70f740e11b0a7679cb94005cc402af921b3ee776 Will update PR accordingly -- 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]
