ruanwenjun commented on code in PR #1781:
URL:
https://github.com/apache/incubator-seatunnel/pull/1781#discussion_r866431270
##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-jdbc/src/main/java/org/apache/seatunnel/flink/jdbc/source/JdbcSource.java:
##########
@@ -273,12 +234,13 @@ private RowTypeInfo getRowTypeInfo() {
return new RowTypeInfo(typeInformation, names);
}
- private TypeInformationMap getTypeInformationMap(String driverName) {
- driverName = driverName.toLowerCase();
- if (driverName.contains("mysql")) {
+ private TypeInformationMap getTypeInformationMap(String databaseDialect) {
+ if ("mysql".equalsIgnoreCase(databaseDialect)) {
return new MysqlTypeInformationMap();
- } else if (driverName.contains("postgresql")) {
+ } else if ("postgresql".equalsIgnoreCase(databaseDialect)) {
return new PostgresTypeInformationMap();
+ } else if ("oracle".equalsIgnoreCase(databaseDialect)) {
+ return new OracleTypeInformationMap();
Review Comment:
I didn't test on all database, but in my knowledge, the result of
`getDatabaseProductName` from oracle driver may not `oracle`, it will contain
other character. So it's better to use
`StringUtils.containsIgnoreCase(databaseDialect, "xx")`.
--
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]