You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by si...@apache.org on 2022/12/13 19:00:41 UTC
[hudi] 05/10: [HUDI-4764] AWS GlueSync turn partition already exist error into warning (#6505)
This is an automated email from the ASF dual-hosted git repository.
sivabalan pushed a commit to branch release-0.12.2-shadow
in repository https://gitbox.apache.org/repos/asf/hudi.git
commit ed989b6ef4317553ff891f21ff6c7be636cf7772
Author: Nicolas Paris <ni...@riseup.net>
AuthorDate: Wed Dec 7 14:00:56 2022 +0100
[HUDI-4764] AWS GlueSync turn partition already exist error into warning (#6505)
---
.../java/org/apache/hudi/aws/sync/AWSGlueCatalogSyncClient.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hudi-aws/src/main/java/org/apache/hudi/aws/sync/AWSGlueCatalogSyncClient.java b/hudi-aws/src/main/java/org/apache/hudi/aws/sync/AWSGlueCatalogSyncClient.java
index d9c4ecd96af..d0adbc9489a 100644
--- a/hudi-aws/src/main/java/org/apache/hudi/aws/sync/AWSGlueCatalogSyncClient.java
+++ b/hudi-aws/src/main/java/org/apache/hudi/aws/sync/AWSGlueCatalogSyncClient.java
@@ -138,8 +138,12 @@ public class AWSGlueCatalogSyncClient extends HoodieSyncClient {
BatchCreatePartitionResult result = awsGlue.batchCreatePartition(request);
if (CollectionUtils.nonEmpty(result.getErrors())) {
- throw new HoodieGlueSyncException("Fail to add partitions to " + tableId(databaseName, tableName)
+ if (result.getErrors().stream().allMatch((error) -> "AlreadyExistsException".equals(error.getErrorDetail().getErrorCode()))) {
+ LOG.warn("Partitions already exist in glue: " + result.getErrors());
+ } else {
+ throw new HoodieGlueSyncException("Fail to add partitions to " + tableId(databaseName, tableName)
+ " with error(s): " + result.getErrors());
+ }
}
Thread.sleep(BATCH_REQUEST_SLEEP_MILLIS);
}