This is an automated email from the ASF dual-hosted git repository.
codope pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new b34e812937d [HUDI-4764] AWS GlueSync turn partition already exist
error into warning (#6505)
b34e812937d is described below
commit b34e812937d318d89bc92cb1d898352913897944
Author: Nicolas Paris <[email protected]>
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 19220323540..384e99ac4ca 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
@@ -141,8 +141,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);
}