Skip to content

[Cherry-pick to branch-1.2] [#10311] fix(optimizer): resolve built-in rewrite adapter by template name (#10307)#10312

Merged
diqiu50 merged 1 commit intobranch-1.2from
cherry-pick-1ad5c69e-to-branch-1.2
Mar 9, 2026
Merged

[Cherry-pick to branch-1.2] [#10311] fix(optimizer): resolve built-in rewrite adapter by template name (#10307)#10312
diqiu50 merged 1 commit intobranch-1.2from
cherry-pick-1ad5c69e-to-branch-1.2

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Mar 9, 2026

Cherry-pick Information:

  • Original commit: 1ad5c69
  • Target branch: branch-1.2
  • Status: ✅ Clean cherry-pick (no conflicts)

… name (#10307)

### What changes were proposed in this pull request?

This PR fixes built-in adapter resolution for optimizer strategy job
submission:

- Map built-in template name `builtin-iceberg-rewrite-data-files` to
`GravitinoCompactionJobAdapter` in `GravitinoJobSubmitter`.
- Remove the legacy strategy-type alias mapping from the built-in
adapter registry.
- Update unit tests to align with the template-name-based contract.

### Why are the changes needed?

`submit-strategy-jobs` submits jobs using the job template name from
strategy/policy content.
Before this change, built-in adapter lookup relied on a strategy-type
alias path, which can cause submission failures like:

`No job adapter found for template: builtin-iceberg-rewrite-data-files`

This patch makes the lookup consistent with actual runtime input
(`jobTemplateName`).

Fix: #10311 

### Does this PR introduce _any_ user-facing change?

Yes, a user-visible bug fix in optimizer behavior:

- `gravitino-optimizer.sh --type submit-strategy-jobs` can now resolve
the built-in rewrite template adapter through the default template-name
mapping.
- No user-facing API changes.
- No property key additions/removals.

### How was this patch tested?

- Added/updated unit tests in `TestGravitinoJobSubmitter`.
- Ran:

```bash
./gradlew :maintenance:optimizer:test --tests org.apache.gravitino.maintenance.optimizer.recommender.job.TestGravitinoJobSubmitter -PskipITs
```

- Result: BUILD SUCCESSFUL.
@github-actions github-actions bot requested a review from jerryshao March 9, 2026 11:10
@jerryshao jerryshao closed this Mar 9, 2026
@jerryshao jerryshao reopened this Mar 9, 2026
@diqiu50 diqiu50 merged commit 34dd579 into branch-1.2 Mar 9, 2026
23 checks passed
@jerryshao jerryshao deleted the cherry-pick-1ad5c69e-to-branch-1.2 branch March 19, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants