Skip to content

Commit cb7c95d

Browse files
committed
fix
1 parent 0382957 commit cb7c95d

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/main/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksEnrichedCatalog.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ public void createTable(StarRocksTable table, boolean ignoreIfExists)
5050
LOG.info(
5151
"Success to create table {}.{}, sql: {}",
5252
table.getDatabaseName(),
53-
table.getDatabaseName(),
53+
table.getTableName(),
5454
createTableSql);
5555
} catch (Exception e) {
5656
LOG.error(
5757
"Failed to create table {}.{}, sql: {}",
5858
table.getDatabaseName(),
59-
table.getDatabaseName(),
59+
table.getTableName(),
6060
createTableSql,
6161
e);
6262
throw new StarRocksCatalogException(
6363
String.format(
6464
"Failed to create table %s.%s",
65-
table.getDatabaseName(), table.getDatabaseName()),
65+
table.getDatabaseName(), table.getTableName()),
6666
e);
6767
}
6868
}

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/test/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksMetadataApplierITCase.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ private List<Event> generateAddColumnEvents(TableId tableId) {
103103
.column(new PhysicalColumn("number", DataTypes.DOUBLE(), null))
104104
.column(
105105
new PhysicalColumn(
106-
"name", DataTypes.VARCHAR(17), "\"name\"", "\"\""))
106+
"name",
107+
DataTypes.VARCHAR(17),
108+
"\"name\"",
109+
"\"name\\\\default\""))
107110
.primaryKey("id")
108111
.build();
109112

@@ -134,7 +137,7 @@ private List<Event> generateAddColumnEvents(TableId tableId) {
134137
"extra_string",
135138
DataTypes.VARCHAR(17),
136139
"\"extra_string\"",
137-
"\"\"")))));
140+
"\"extra\\\\string\"")))));
138141
}
139142

140143
private List<Event> generateDropColumnEvents(TableId tableId) {
@@ -294,11 +297,11 @@ void testStarRocksAddColumn() throws Exception {
294297
Arrays.asList(
295298
"id | int | NO | true | null",
296299
"number | double | YES | false | null",
297-
"name | varchar(51) | YES | false | \"\"",
300+
"name | varchar(51) | YES | false | \"name\\\\default\"",
298301
"extra_date | date | YES | false | null",
299302
"extra_bool | boolean | YES | false | null",
300303
"extra_decimal | decimal(17,0) | YES | false | null",
301-
"extra_string | varchar(51) | YES | false | \"\"");
304+
"extra_string | varchar(51) | YES | false | \"extra\\\\string\"");
302305

303306
assertEqualsInOrder(expected, actual);
304307
}

0 commit comments

Comments
 (0)