xiaochen-zhou commented on code in PR #9982:
URL: https://github.com/apache/seatunnel/pull/9982#discussion_r2516578093
##########
seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/PaimonSink.java:
##########
@@ -92,11 +99,25 @@ public PaimonSink(ReadonlyConfig readonlyConfig,
CatalogTable catalogTable) {
paimonCatalog.open();
boolean databaseExists =
paimonCatalog.databaseExists(this.paimonSinkConfig.getNamespace());
- if (databaseExists) {
- TablePath tablePath = catalogTable.getTablePath();
- boolean tableExists = paimonCatalog.tableExists(tablePath);
- if (tableExists) {
- this.paimonTable = paimonCatalog.getPaimonTable(tablePath);
+ if (!databaseExists) {
+ return;
+ }
+ TablePath tablePath = catalogTable.getTablePath();
+ boolean tableExists = paimonCatalog.tableExists(tablePath);
+ if (!tableExists) {
+ return;
+ }
+ this.paimonTable = (FileStoreTable)
paimonCatalog.getPaimonTable(tablePath);
+ String branchName = paimonSinkConfig.getBranch();
+ if (StringUtils.isNotEmpty(branchName)) {
+ BranchManager branchManager = paimonTable.branchManager();
+ if (!branchManager.branchExists(branchName)) {
+ throw new UnsupportedOperationException(
+ "Branch: " + branchName + " not exists");
Review Comment:
> `PaimonConnectorErrorCode` Error messages can be extracted
Done.
--
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]