macdoor opened a new pull request, #17987:
URL: https://github.com/apache/dolphinscheduler/pull/17987
## Purpose of the pull request
Add parameter replacement support for **Flink** and **Flink Stream** task
plugins. `initScript` and `rawScript` can use DolphinScheduler built-in and
custom parameters (e.g. `${system.biz.date}`, `${localParams.xxx}`), consistent
with other task types.
## Brief change log
- In `FlinkTask` and `FlinkStreamTask`, apply
`ParameterUtils.convertParameterPlaceholders()` to `initScript` and `rawScript`
in `init()` using `taskExecutionContext.getPrepareParamsMap()`
- Add unit tests (`FlinkTaskTest`, `FlinkStreamTaskTest`) to verify
parameter replacement for `${var}` placeholders and `$[yyyyMMdd]` time
expressions
- No new dependencies; reuses existing `ParameterUtils` and task API
## Verify this pull request
This change added tests and can be verified as follows:
- Added `FlinkTaskTest` and `FlinkStreamTaskTest` with test cases:
- `testInitReplacesPlaceholdersInInitScriptAndRawScript()`: Verifies
`${var}` replacement with custom parameters
- `testInitReplacesTimePlaceholderWhenParamMapContainsScheduleTime()`:
Verifies `$[yyyyMMdd]` time placeholder replacement
- Run tests: `mvn test -pl
dolphinscheduler-task-plugin/dolphinscheduler-task-flink,dolphinscheduler-task-plugin/dolphinscheduler-task-flink-stream
-Dtest=FlinkTaskTest,FlinkStreamTaskTest`
- Manually verified: Create a Flink (or Flink Stream) task with placeholders
in init script or main script (e.g. `${system.biz.date}`), run the workflow and
confirm the placeholders are replaced correctly at runtime
## Pull Request Notice
[Pull Request
Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
If your pull request contains incompatible change, you should also add it to
`docs/docs/en/guide/upgrade/incompatible.md`
---
closes #17986
--
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]