You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/05/06 03:02:47 UTC

[GitHub] [incubator-seatunnel] BenJFan commented on a diff in pull request #1781: [Bug] [flink-connector-jdbc]change jdbc Source connector to get fields from jdbc meta data and support oracle database

BenJFan commented on code in PR #1781:
URL: https://github.com/apache/incubator-seatunnel/pull/1781#discussion_r866456376


##########
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:
   Maybe use equal is fine in here, but use contains will alway more safer.



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org