Skip to content

feat: add Iceberg table tag management UI and API#4164

Open
fightBoxing wants to merge 4 commits intoapache:masterfrom
fightBoxing:feature/iceberg-tag-management
Open

feat: add Iceberg table tag management UI and API#4164
fightBoxing wants to merge 4 commits intoapache:masterfrom
fightBoxing:feature/iceberg-tag-management

Conversation

@fightBoxing
Copy link
Copy Markdown

Summary

  • Add createTag and deleteTag API endpoints for Iceberg tables (POST/DELETE /ams/v1/tables/catalogs/{catalog}/dbs/{db}/tables/{table}/tags)
  • Implement tag creation and deletion logic in MixedAndIcebergTableDescriptor using Iceberg TableMetadata API
  • Add CreateTagRequest DTO in TableController to replace unsafe Map<String, Object> deserialization
  • Add createTag / deleteTag service functions in frontend table.service.ts
  • Add Create Tag modal and Delete Tag confirmation in Selector.vue with snapshot ID and optional max-ref-age inputs
  • Extend FormatTableDescriptor interface and ServerTableDescriptor with tag management methods

Test Plan

  • Start Amoro server and open Web UI
  • Navigate to an Iceberg table → Tags tab
  • Click "Create Tag", fill in tag name and snapshot ID, confirm creation succeeds
  • Verify new tag appears in the tag list
  • Click delete icon on a tag, confirm deletion succeeds
  • Verify deleted tag is removed from the list
  • Verify Checkstyle: 0 violations
  • Verify Spotless: BUILD SUCCESS

@github-actions github-actions Bot added type:docs Improvements or additions to documentation module:ams-server Ams server module type:infra type:build labels Apr 2, 2026
@czy006
Copy link
Copy Markdown
Contributor

czy006 commented Apr 3, 2026

@fightBoxing Thank you for your contribution. You need to trigger CI after rebasing the branch to proceed to the review stage.

- Backend: Add createTag/deleteTag API endpoints in TableController
- Backend: Add createTag/deleteTag interface in FormatTableDescriptor
- Backend: Implement tag operations in MixedAndIcebergTableDescriptor using Iceberg TableOperations
- Backend: Add unsupported exception for Paimon in PaimonTableDescriptor
- Backend: Register /tags routes in DashboardServer
- Backend: Add createTag/deleteTag methods in ServerTableDescriptor
- Backend: Use CreateTagRequest DTO instead of raw Map for type safety
- Frontend: Add Create Tag dialog with tag name and snapshot ID inputs in Selector.vue
- Frontend: Add Delete Tag confirmation dialog in Selector.vue
- Frontend: Add createTag/deleteTag API calls in table.service.ts
- Frontend: Add i18n translations for tag operations in en.ts and zh.ts
@fightBoxing fightBoxing force-pushed the feature/iceberg-tag-management branch from 3b680f9 to 07a2317 Compare April 9, 2026 11:17
@github-actions github-actions Bot added module:ams-dashboard Ams dashboard module module:common and removed type:docs Improvements or additions to documentation type:infra type:build labels Apr 9, 2026
@fightBoxing
Copy link
Copy Markdown
Author

@fightBoxing Thank you for your contribution. You need to trigger CI after rebasing the branch to proceed to the review stage.

Thanks, I updated my PR again.

TableMetadata updated = builder.build();
ops.commit(base, updated);
}
AmoroTable<?> amoroTable, String type, ProcessStatus status, int limit, int offset) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] Broken method signature causes compilation failure.\n\nReason summary: right after deleteTag, the method declaration for getOptimizingProcessesInfo(...) is missing, so this file becomes syntactically invalid (; expected) and amoro-ams cannot build.\n\nSuggested fix: restore the full method signature (@Override, return type, method name, params) and rerun ./mvnw -pl amoro-ams -am -DskipTests -Pskip-dashboard-build compile to verify.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this 090c167

Preconditions.checkNotNull(
base.snapshot(snapshotId), "Snapshot %s not found in table", snapshotId);

TableMetadata.Builder builder = TableMetadata.buildFrom(base);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] createTag currently uses setRef without guarding name conflicts.\n\nReason summary: builder.setRef(tagName, ...) can overwrite an existing ref with the same name, which is riskier than Iceberg createTag semantics (create-only, fail on existing ref).\n\nSuggested fix: add a pre-check such as Preconditions.checkArgument(base.ref(tagName) == null, ...) before setting the ref, or switch to an Iceberg create-tag path that enforces non-overwrite behavior.

}

// Open the Create Tag modal
function openCreateTagModal(e: MouseEvent) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] The Create Tag flow is currently unreachable from UI.\n\nReason summary: openCreateTagModal is defined, but there is no template trigger bound to it, so users cannot actually open the modal and call the new create-tag API.\n\nSuggested fix: add a visible trigger (for example in the Tags tab/footer action area) and bind it to openCreateTagModal.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested the functionality, and it is working correctly. Below are some screenshots of the tests.

image image

*
* @param ctx - context for handling the request and response
*/
public void createTag(Context ctx) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Missing test coverage for the new tag management API/flow.\n\nReason summary: this PR adds POST/DELETE tags, descriptor logic, and UI changes, but there are no accompanying tests in backend or frontend for success/error paths.\n\nSuggested fix: add at least controller/descriptor tests (create success, duplicate name, invalid snapshot, delete missing tag) and UI interaction tests (entry visibility, create/delete success/failure feedback).

@czy006
Copy link
Copy Markdown
Contributor

czy006 commented Apr 16, 2026

[P0] amoro-format-hudi/src/main/java/org/apache/amoro/formats/hudi/HudiTableDescriptor.java:95 is missing implementations for the new FormatTableDescriptor methods (createTag / deleteTag).\n\nReason summary: after extending the interface, Hudi is no longer implementing all abstract methods, so amoro-format-hudi fails to compile in multi-lake builds.\n\nSuggested fix: implement both methods in HudiTableDescriptor (if unsupported, throw explicit UnsupportedOperationException with clear message) and verify with ./mvnw -pl amoro-format-hudi -am -DskipTests compile.

rockyyin added 2 commits April 23, 2026 12:57
- [P0] Restore missing getOptimizingProcessesInfo method signature in
  MixedAndIcebergTableDescriptor that was accidentally dropped after
  deleteTag method, causing compilation failure in amoro-ams module

- [P0] Implement createTag/deleteTag in HudiTableDescriptor to satisfy
  the FormatTableDescriptor interface contract; Hudi does not support
  tag management so both methods throw UnsupportedOperationException
  with a clear message
- [P1] Guard createTag against name conflicts in MixedAndIcebergTableDescriptor.
  Previously builder.setRef(tagName, ...) would silently overwrite an existing
  tag or branch with the same name. Add a Preconditions.checkArgument on
  base.ref(tagName) == null to match Iceberg createTag create-only semantics.

- [P1] Bind a visible Create Tag trigger in Selector.vue. openCreateTagModal was
  defined but had no template trigger, so users could not open the modal. Add a
  '+ Create Tag' link button at the bottom of the Tags tab-pane (using the
  pre-defined .create-tag-btn-wrapper style), wired to openCreateTagModal.
@fightBoxing fightBoxing requested a review from czy006 April 23, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants