You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by wu...@apache.org on 2025/04/08 05:31:47 UTC

(seatunnel) branch dev updated: [Fix][Connector-V2] Fix maxcompute write with multi parallelism (#9089)

This is an automated email from the ASF dual-hosted git repository.

wuchunfu pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new 9426b7ba2c [Fix][Connector-V2] Fix maxcompute write with multi parallelism (#9089)
9426b7ba2c is described below

commit 9426b7ba2c1d74d37cb1dfb2dcbcf30eeaac1833
Author: Jia Fan <fa...@qq.com>
AuthorDate: Tue Apr 8 13:31:43 2025 +0800

    [Fix][Connector-V2] Fix maxcompute write with multi parallelism (#9089)
---
 .../connectors/seatunnel/maxcompute/sink/MaxcomputeWriter.java       | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/sink/MaxcomputeWriter.java b/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/sink/MaxcomputeWriter.java
index f72a3124b0..9de521a493 100644
--- a/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/sink/MaxcomputeWriter.java
+++ b/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/sink/MaxcomputeWriter.java
@@ -47,7 +47,6 @@ public class MaxcomputeWriter extends AbstractSinkWriter<SeaTunnelRow, Void>
     private RecordWriter recordWriter;
     private final TableTunnel.UploadSession session;
     private final TableSchema tableSchema;
-    private static final Long BLOCK_0 = 0L;
     private final SeaTunnelRowType rowType;
 
     public MaxcomputeWriter(ReadonlyConfig readonlyConfig, SeaTunnelRowType rowType) {
@@ -68,7 +67,7 @@ public class MaxcomputeWriter extends AbstractSinkWriter<SeaTunnelRow, Void>
                         tunnel.createUploadSession(
                                 readonlyConfig.get(PROJECT), readonlyConfig.get(TABLE_NAME));
             }
-            this.recordWriter = session.openRecordWriter(BLOCK_0);
+            this.recordWriter = session.openBufferedWriter();
             log.info("open record writer success");
         } catch (Exception e) {
             throw new MaxcomputeConnectorException(
@@ -89,7 +88,7 @@ public class MaxcomputeWriter extends AbstractSinkWriter<SeaTunnelRow, Void>
         if (recordWriter != null) {
             recordWriter.close();
             try {
-                session.commit(new Long[] {BLOCK_0});
+                session.commit();
             } catch (Exception e) {
                 throw new MaxcomputeConnectorException(
                         CommonErrorCodeDeprecated.WRITER_OPERATION_FAILED, e);