FANNG1 commented on code in PR #6432:
URL: https://github.com/apache/gravitino/pull/6432#discussion_r1972721903
##########
integration-test-common/src/test/java/org/apache/gravitino/integration/test/container/MySQLContainer.java:
##########
@@ -119,6 +119,14 @@ public void createDatabase(TestDatabaseName
testDatabaseName) {
StringUtils.substring(
getJdbcUrl(testDatabaseName), 0,
getJdbcUrl(testDatabaseName).lastIndexOf("/"));
+ // Fix https://github.com/apache/gravitino/issues/6392, MYSQL JDBC driver
may not load
+ // automatically.
+ try {
+ Class.forName("com.mysql.jdbc.Driver");
Review Comment:
```java
// This steps will load JDBC drivers in `IsolatedClientLoader` and can't
reuse these drivers in App class loader
1. getSparkSession().sql(query).collectAsList();
// Get MySQL connection in the App classloader
2. DriverManager.getConnection()
```
I guess this will report error, but this pattern is seldom used, and not the
scope of Gravitino, the pattern is like why the failure happened, SparkRESTIT
loads the driver in `IsolatedClientLoader`, SparkJDBCIT get MySQL connection
failed for missing driver. Spark JDBC catalog load corresponding Jdbc driver
explicitly to make sure the driver is loaded when executing SparkSQLs.
--
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]