JNSimba commented on code in PR #303:
URL: 
https://github.com/apache/doris-flink-connector/pull/303#discussion_r1461567174


##########
flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/SourceSchema.java:
##########
@@ -33,57 +31,23 @@
 import java.util.StringJoiner;
 
 public abstract class SourceSchema {
-    private final String databaseName;
-    private final String schemaName;
-    private final String tableName;
-    private final String tableComment;
-    private final LinkedHashMap<String, FieldSchema> fields;
-    public final List<String> primaryKeys;
+    public final String databaseName;
+    public final String schemaName;
+    public final String tableName;
+    public final String tableComment;
+    public LinkedHashMap<String, FieldSchema> fields;
+    public List<String> primaryKeys;
     public DataModel model = DataModel.UNIQUE;
 
     public SourceSchema(
-            DatabaseMetaData metaData,
-            String databaseName,
-            String schemaName,
-            String tableName,
-            String tableComment)
+            String databaseName, String schemaName, String tableName, String 
tableComment)
             throws Exception {
         this.databaseName = databaseName;
         this.schemaName = schemaName;
         this.tableName = tableName;
         this.tableComment = tableComment;
-
-        fields = new LinkedHashMap<>();
-        try (ResultSet rs = metaData.getColumns(databaseName, schemaName, 
tableName, null)) {
-            while (rs.next()) {
-                String fieldName = rs.getString("COLUMN_NAME");
-                String comment = rs.getString("REMARKS");
-                String fieldType = rs.getString("TYPE_NAME");
-                Integer precision = rs.getInt("COLUMN_SIZE");
-
-                if (rs.wasNull()) {
-                    precision = null;
-                }
-                Integer scale = rs.getInt("DECIMAL_DIGITS");
-                if (rs.wasNull()) {
-                    scale = null;
-                }
-                String dorisTypeStr = convertToDorisType(fieldType, precision, 
scale);
-                fields.put(fieldName, new FieldSchema(fieldName, dorisTypeStr, 
comment));
-            }
-        }
-
-        primaryKeys = new ArrayList<>();
-        try (ResultSet rs = metaData.getPrimaryKeys(databaseName, schemaName, 
tableName)) {
-            while (rs.next()) {
-                String fieldName = rs.getString("COLUMN_NAME");
-                primaryKeys.add(fieldName);
-            }
-        }
     }
 
-    public abstract String convertToDorisType(String fieldType, Integer 
precision, Integer scale);

Review Comment:
   Do we need to delete this too?



-- 
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-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to