dailai commented on code in PR #7834:
URL: https://github.com/apache/seatunnel/pull/7834#discussion_r1803961677


##########
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
+                                || changelogProducer
+                                        == 
CoreOptions.ChangelogProducer.FULL_COMPACTION)
+                        ? tableWriteBuilder
+                                .newWrite()
+                                .withIOManager(new 
IOManagerImpl(changelogTmpPath))

Review Comment:
   This may have some problem because the default value of changelogTmpPath 
which use the`System.getProperty("java.io.tmpdir")` to get it that can be like 
this path1,path2,path3.
   So you can set IOManager like this: IOManager.create(splitPaths(TMP_DIRS).  
And the method named splitPaths is 
org.apache.paimon.disk.IOManagerImpl#splitPaths.



-- 
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]

Reply via email to