mchades commented on code in PR #14040:
URL: https://github.com/apache/gravitino/pull/14040#discussion_r4335368300
##########
catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/FilesetCatalogOperations.java:
##########
@@ -727,10 +726,15 @@ public Fileset alterFileset(NameIdentifier ident,
FilesetChange... changes)
throw ExceptionMessages.wrap("Failed to update fileset " + ident, ioe);
} catch (NoSuchEntityException nsee) {
throw new NoSuchFilesetException(nsee, FILESET_DOES_NOT_EXIST_MSG,
ident);
- } catch (AlreadyExistsException aee) {
- // This is happened when renaming a fileset to an existing fileset name.
- throw ExceptionMessages.wrap(
- "Fileset with the same name " + ident.name() + " already exists",
aee);
+ } catch (EntityAlreadyExistsException e) {
+ String newName =
+ Arrays.stream(changes)
+ .filter(c -> c instanceof FilesetChange.RenameFileset)
+ .map(c -> ((FilesetChange.RenameFileset) c).getNewName())
+ .reduce((first, second) -> second)
Review Comment:
This duplicates your [earlier shared-helper/Tag
comment](https://github.com/apache/gravitino/pull/14040#discussion_r4333721627).
`RenameUtils` and the multi-rename Tag regression test address both points.
--
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]