dyp12 commented on code in PR #9805:
URL: https://github.com/apache/seatunnel/pull/9805#discussion_r2320642133
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/CanalJsonWriteStrategy.java:
##########
@@ -45,13 +46,18 @@ public class CanalJsonWriteStrategy extends
AbstractWriteStrategy<FSDataOutputSt
private final LinkedHashMap<String, FSDataOutputStream>
beingWrittenOutputStream;
private final Map<String, Boolean> isFirstWrite;
private final Charset charset;
+ private final Map<String, String> options;
public CanalJsonWriteStrategy(FileSinkConfig textFileSinkConfig) {
super(textFileSinkConfig);
this.beingWrittenOutputStream = new LinkedHashMap<>();
this.isFirstWrite = new HashMap<>();
this.charset =
EncodingUtils.tryParseCharset(textFileSinkConfig.getEncoding());
this.rowDelimiter =
textFileSinkConfig.getRowDelimiter().getBytes(charset);
+ this.options = new HashMap<>();
+ this.options.put(
+ CanalJsonFormatOptions.MERGE_UPDATE_EVENT.key(),
+ textFileSinkConfig.getMergeUpdateEvent().toString());
Review Comment:
> why introduce options? Let's keep the code simple.
if not, the CanalJsonSerializationSchema() will add a param. if we want
change other , will add a param,and the CanalJsonSerializationSchema() will
have many param. use Map can keep the code simple.
--
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]