echonesis opened a new pull request, #9960:
URL: https://github.com/apache/gravitino/pull/9960
### What changes were proposed in this pull request?
Add support for optional arguments in job templates using `?` prefix marker.
- Modified `JobManager.buildArgumentsWithOptional()` to filter optional
arguments
- Arguments prefixed with `?` are removed if their placeholder value is
empty/null
- Supports flag-value pairing (e.g., `?--strategy ?{{strategy}}`)
- Updated `JobTemplate` JavaDoc with usage examples
### Why are the changes needed?
Current job templates require fixed-length arguments.
Users must provide empty strings for optional parameters, resulting in
useless arguments like `--strategy ""`.
Fix: #(9857)
### Does this PR introduce _any_ user-facing change?
Yes. Template creators can mark arguments as optional with `?` prefix:
```java
.withArguments(Lists.newArrayList(
"--catalog", "{{catalog}}", // Required
"?--strategy", "?{{strategy}}" // Optional
))
```
### How was this patch tested?
- Unit Test: `TestJobManager`
- Integration Test: `TestJobTemplate` and `JobIT`
--
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]