Skip to content

Commit 23a744b

Browse files
authored
[Hotfix][Connector-V2] Close the tableWrite when task is close (#6897)
1 parent 264934f commit 23a744b

File tree

1 file changed

+11
-1
lines changed
  • seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink

1 file changed

+11
-1
lines changed

seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/PaimonSinkWriter.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.seatunnel.api.sink.SupportMultiTableSinkWriter;
2323
import org.apache.seatunnel.api.table.type.SeaTunnelRow;
2424
import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
25+
import org.apache.seatunnel.common.utils.SeaTunnelException;
2526
import org.apache.seatunnel.connectors.seatunnel.paimon.config.PaimonHadoopConfiguration;
2627
import org.apache.seatunnel.connectors.seatunnel.paimon.exception.PaimonConnectorErrorCode;
2728
import org.apache.seatunnel.connectors.seatunnel.paimon.exception.PaimonConnectorException;
@@ -182,5 +183,14 @@ public List<PaimonSinkState> snapshotState(long checkpointId) throws IOException
182183
public void abortPrepare() {}
183184

184185
@Override
185-
public void close() throws IOException {}
186+
public void close() throws IOException {
187+
if (Objects.nonNull(tableWrite)) {
188+
try {
189+
tableWrite.close();
190+
} catch (Exception e) {
191+
log.error("Failed to close table writer in paimon sink writer.", e);
192+
throw new SeaTunnelException(e);
193+
}
194+
}
195+
}
186196
}

0 commit comments

Comments
 (0)