litiliu commented on code in PR #7671:
URL: https://github.com/apache/seatunnel/pull/7671#discussion_r1764615000
##########
seatunnel-translation/seatunnel-translation-flink/seatunnel-translation-flink-common/src/main/java/org/apache/seatunnel/translation/flink/sink/FlinkSink.java:
##########
@@ -91,17 +89,30 @@ public Optional<GlobalCommitter<CommitWrapper<CommT>,
GlobalCommT>> createGlobal
@Override
public Optional<SimpleVersionedSerializer<CommitWrapper<CommT>>>
getCommittableSerializer() {
- return
sink.getCommitInfoSerializer().map(CommitWrapperSerializer::new);
+ if (checkForCommitter())
+ return
sink.getCommitInfoSerializer().map(CommitWrapperSerializer::new);
+ else return Optional.empty();
}
@Override
public Optional<SimpleVersionedSerializer<GlobalCommT>>
getGlobalCommittableSerializer() {
- return
sink.getAggregatedCommitInfoSerializer().map(FlinkSimpleVersionedSerializer::new);
+ if (checkForCommitter())
Review Comment:
there should be a `{` behind the if clause, it make reading easyier.
##########
seatunnel-core/seatunnel-flink-starter/seatunnel-flink-13-starter/src/main/java/org/apache/seatunnel/core/starter/flink/execution/SinkExecuteProcessor.java:
##########
@@ -171,4 +191,40 @@ public SeaTunnelSink fallbackCreateSink(
source.prepare(pluginConfig);
return source;
}
+
+ // catalogName.databaseName.[schemeName].tableName ->
databaseName.[schemeName].tableName
+ public String extractTableIdName(TableIdentifier tableIdentifier) {
Review Comment:
is it better to add ut to cover this logic?
##########
seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/execution/SinkExecuteProcessor.java:
##########
@@ -175,4 +194,40 @@ public SeaTunnelSink fallbackCreateSink(
source.prepare(pluginConfig);
return source;
}
+
+ // catalogName.databaseName.[schemeName].tableName ->
databaseName.[schemeName].tableName
+ public String extractTableIdName(TableIdentifier tableIdentifier) {
+ StringBuilder tableId = new StringBuilder();
+ if (tableIdentifier.getDatabaseName() != null) {
+ tableId.append(tableIdentifier.getDatabaseName());
+ }
+ if (tableIdentifier.getSchemaName() != null) {
+ if (tableIdentifier.getDatabaseName() != null) {
+ tableId.append(".");
+ }
+ tableId.append(tableIdentifier.getSchemaName());
+ }
+ if (tableIdentifier.getTableName() != null) {
+ if (tableId.length() != 0) {
+ tableId.append(".");
+ }
+ tableId.append(tableIdentifier.getTableName());
+ }
+ return tableId.toString();
+ }
Review Comment:
duplicate with the method in the
seatunnel-core/seatunnel-flink-starter/seatunnel-flink-13-starter/src/main/java/org/apache/seatunnel/core/starter/flink/execution/SinkExecuteProcessor.java
?
--
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]