You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "bingquanzhao (via GitHub)" <gi...@apache.org> on 2024/01/22 09:07:38 UTC
[PR] [improve] add JdbcSourceSchema extends SourceSchema [doris-flink-connector]
bingquanzhao opened a new pull request, #303:
URL: https://github.com/apache/doris-flink-connector/pull/303
add jdbc source schema extends source schema .Making SourceSchema more than just a JDBC-related implementation
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [improve] add JdbcSourceSchema extends SourceSchema [doris-flink-connector]
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
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-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [improve] add JdbcSourceSchema extends SourceSchema [doris-flink-connector]
Posted by "bingquanzhao (via GitHub)" <gi...@apache.org>.
bingquanzhao closed pull request #303: [improve] add JdbcSourceSchema extends SourceSchema
URL: https://github.com/apache/doris-flink-connector/pull/303
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [improve] add JdbcSourceSchema extends SourceSchema [doris-flink-connector]
Posted by "bingquanzhao (via GitHub)" <gi...@apache.org>.
bingquanzhao commented on PR #303:
URL: https://github.com/apache/doris-flink-connector/pull/303#issuecomment-1953826266
> please rebase master, there is a conflict
👌
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [improve] add JdbcSourceSchema extends SourceSchema [doris-flink-connector]
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on PR #303:
URL: https://github.com/apache/doris-flink-connector/pull/303#issuecomment-1951765807
please rebase master, there is a conflict
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [improve] add JdbcSourceSchema extends SourceSchema [doris-flink-connector]
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on code in PR #303:
URL: https://github.com/apache/doris-flink-connector/pull/303#discussion_r1461567449
##########
flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/JdbcSourceSchema.java:
##########
@@ -0,0 +1,50 @@
+package org.apache.doris.flink.tools.cdc;
Review Comment:
add license header
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org