dailai commented on code in PR #7834:
URL: https://github.com/apache/seatunnel/pull/7834#discussion_r1803963722
##########
seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/PaimonSinkWriter.java:
##########
@@ -90,18 +93,33 @@ public PaimonSinkWriter(
Table table,
SeaTunnelRowType seaTunnelRowType,
JobContext jobContext,
+ PaimonSinkConfig paimonSinkConfig,
PaimonHadoopConfiguration paimonHadoopConfiguration) {
- this.table = table;
+ this.table = (FileStoreTable) table;
+ CoreOptions.ChangelogProducer changelogProducer =
+ this.table.coreOptions().changelogProducer();
+ if (changelogProducer != paimonSinkConfig.getChangelogProducer()) {
+ log.warn(
+ "configured 'changelog-producer' is not compatible with
the table, will use the table's 'changelog-producer'");
+ }
+ String changelogTmpPath = paimonSinkConfig.getChangelogTmpPath();
this.tableWriteBuilder =
JobContextUtil.isBatchJob(jobContext)
? this.table.newBatchWriteBuilder()
: this.table.newStreamWriteBuilder();
- this.tableWrite = tableWriteBuilder.newWrite();
+ this.tableWrite =
+ (changelogProducer == CoreOptions.ChangelogProducer.LOOKUP
Review Comment:
This code(` (changelogProducer == CoreOptions.ChangelogProducer.LOOKUP
|| changelogProducer
==
CoreOptions.ChangelogProducer.FULL_COMPACTION)`) suggests abstracting into a
method.
--
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]