Hisoka-X commented on code in PR #6540:
URL: https://github.com/apache/seatunnel/pull/6540#discussion_r1542619515
##########
seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSinkFactory.java:
##########
@@ -89,13 +89,15 @@ public TableSink createSink(TableSinkFactoryContext
context) {
String sinkDatabaseName = sinkConfig.getDatabase();
String sinkTableName = sinkConfig.getTable();
// to replace
- String finalDatabaseName =
- sinkDatabaseName.replace(REPLACE_DATABASE_NAME_KEY,
sourceDatabaseName);
+ if (StringUtils.isNotBlank(sourceDatabaseName)) {
+ sinkDatabaseName =
+ sinkDatabaseName.replace(REPLACE_DATABASE_NAME_KEY,
sourceDatabaseName);
+ }
Review Comment:
I prefer when source database name is null, we can treat it as empty string.
```suggestion
sinkDatabaseName =
sinkDatabaseName.replace(REPLACE_DATABASE_NAME_KEY, sourceDatabaseName != null
? sourceDatabaseName: "");
```
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-starrocks-e2e/pom.xml:
##########
@@ -48,5 +48,11 @@
<version>${mysql.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>kafka</artifactId>
+ <version>${testcontainer.version}</version>
+ <scope>test</scope>
+ </dependency>
Review Comment:
```suggestion
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]