Skip to content

Commit

Permalink
[fix](cdc)resolve the issue of automatic table creation failure in SQ…
Browse files Browse the repository at this point in the history
…L Server due to the presence of the `systranschemas` (#302)
  • Loading branch information
vinlee19 authored Jan 24, 2024
1 parent 1a9e7bc commit 480a2aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ public DataStreamSource<String> buildCdcSource(StreamExecutionEnvironment env) {

@Override
public String getTableListPrefix() {
String schemaName = config.get(OracleSourceOptions.SCHEMA_NAME);
return schemaName;
return config.get(OracleSourceOptions.SCHEMA_NAME);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public List<SourceSchema> getSchemaList() throws Exception {
try (Connection conn = getConnection()) {
DatabaseMetaData metaData = conn.getMetaData();
try (ResultSet tables =
metaData.getTables(databaseName, null, "%", new String[] {"TABLE"})) {
metaData.getTables(databaseName, schemaName, "%", new String[] {"TABLE"})) {
while (tables.next()) {
String tableName = tables.getString("TABLE_NAME");
String tableComment = tables.getString("REMARKS");
Expand All @@ -108,7 +108,7 @@ public List<SourceSchema> getSchemaList() throws Exception {
}
SourceSchema sourceSchema =
new SqlServerSchema(
metaData, databaseName, null, tableName, tableComment);
metaData, databaseName, schemaName, tableName, tableComment);
sourceSchema.setModel(
!sourceSchema.primaryKeys.isEmpty()
? DataModel.UNIQUE
Expand All @@ -129,7 +129,7 @@ public DataStreamSource<String> buildCdcSource(StreamExecutionEnvironment env) {

String tableName = config.get(JdbcSourceOptions.TABLE_NAME);
String hostname = config.get(JdbcSourceOptions.HOSTNAME);
Integer port = config.getInteger(PORT, 1433);
int port = config.getInteger(PORT, 1433);
String username = config.get(JdbcSourceOptions.USERNAME);
String password = config.get(JdbcSourceOptions.PASSWORD);

Expand Down Expand Up @@ -204,7 +204,6 @@ public DataStreamSource<String> buildCdcSource(StreamExecutionEnvironment env) {

@Override
public String getTableListPrefix() {
String schemaName = config.get(JdbcSourceOptions.SCHEMA_NAME);
return schemaName;
return config.get(JdbcSourceOptions.SCHEMA_NAME);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public static String toDorisType(String originSqlServerType, Integer precision,
case DATETIMEOFFSET:
case TIMESTAMP:
case UNIQUEIDENTIFIER:
case BINARY:
case VARBINARY:
return DorisType.STRING;
default:
throw new UnsupportedOperationException(
Expand Down

0 comments on commit 480a2aa

Please sign in to comment.