ClaireLytt commented on code in PR #36492:
URL: https://github.com/apache/shardingsphere/pull/36492#discussion_r2347280045
##########
test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/DataSetEnvironmentManager.java:
##########
@@ -234,6 +259,19 @@ public Void call() throws SQLException {
return null;
}
+ private DatabaseType getDatabaseType(final Connection connection)
throws SQLException {
+ try {
+ String url = connection.getMetaData().getURL();
+ return DatabaseTypeFactory.get(url);
+ } catch (final SQLFeatureNotSupportedException ex) {
+ String driverName = connection.getMetaData().getDriverName();
+ if (driverName != null &&
driverName.toLowerCase().contains("hive")) {
+ return
DatabaseTypeFactory.get("jdbc:hive2://localhost:10000/default");
Review Comment:
If return `HiveDatabaseType` ,it may lead to the occurrence of
`ServiceProviderNotFoundException: No implementation class load from SPI
'DialectDatabaseMetaData' with type 'null'` errors, so I choose to use
`TypedSPILoader`
##########
test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/DataSetEnvironmentManager.java:
##########
@@ -234,6 +259,19 @@ public Void call() throws SQLException {
return null;
}
+ private DatabaseType getDatabaseType(final Connection connection)
throws SQLException {
+ try {
+ String url = connection.getMetaData().getURL();
+ return DatabaseTypeFactory.get(url);
+ } catch (final SQLFeatureNotSupportedException ex) {
+ String driverName = connection.getMetaData().getDriverName();
+ if (driverName != null &&
driverName.toLowerCase().contains("hive")) {
Review Comment:
done
--
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]