macdoor opened a new pull request, #18690: URL: https://github.com/apache/dolphinscheduler/pull/18690
## Was this PR generated or assisted by AI? **YES** — the plugin code was initially developed with AI-assisted tooling (Cursor) and this port/adaptation (rebasing onto dev-SNAPSHOT, adopting the `SqlSourceType` enum from task-api, refactor for testability, and unit-test authoring) was assisted by an AI agent (Hermes). All changes were human-reviewed and verified by build + unit tests. ## Purpose of the pull request Add a new task plugin **FLINK_SGW** that submits SQL scripts to a [Flink SQL Gateway](https://nightlies.apache.org/flink/flink-docs-stable/docs/dev/table/sql-gateway/) through its JDBC driver (`flink-sql-jdbc-driver`), enabling DolphinScheduler to schedule batch SQL workloads without a local Flink client. The task type is named `FLINK_SGW` instead of the longer `FLINK_SQL_GATEWAY`: the long name wraps and breaks the DAG node / task-type picker layout; the short alias reuses the Flink family icon and keeps nodes readable (see linked issue). ## Brief change log - Add `dolphinscheduler-task-flink-sqlgateway` module (`FlinkSqlGatewayParameters` / `FlinkSqlGatewayTask` / `FlinkSqlGatewayTaskChannel` / `FlinkSqlGatewayTaskChannelFactory`) - Register the module in `dolphinscheduler-task-plugin/pom.xml` and wire it into `dolphinscheduler-task-all` - Register `FLINK_SGW` in `task-type-config.yaml` - UI: task-type constants, store registration, node form fields (`use-flink-sqlgateway`), format-data serialization, icon fallback (reuse `flink.png`), locales (en/zh) - `use-resources` field helper gains optional `limit` / `field` parameters to support the init-script resource field Design notes: - Script sources reuse `org.apache.dolphinscheduler.plugin.task.api.enums.SqlSourceType` (`SCRIPT` / `FILE`) introduced by #18020, instead of duplicating constants - Init + main script resolution share one code path; statement splitting and comment-stripping are package-private static methods covered by plain JUnit tests (no Mockito) - The shaded plugin jar is self-contained (bundles the Flink SQL Gateway JDBC driver); `task-api` / `common` stay `provided` ## Verify this pull request This change added tests and can be verified as follows: - `mvn test -pl dolphinscheduler-task-plugin/dolphinscheduler-task-flink-sqlgateway -am` — `FlinkSqlGatewayParametersTest` (12 checks: parameter validation across SCRIPT/FILE combinations, resource aggregation, JDBC property filtering) and `FlinkSqlGatewayTaskTest` (statement splitting incl. regex-special separators, leading comment/blank stripping) - `mvn package -pl dolphinscheduler-task-plugin/dolphinscheduler-task-flink-sqlgateway -am` builds the shaded jar cleanly - The plugin binary has been deployed and exercised in an internal production environment since 2026-03 (scheduled batch SQL through a dedicated SQL Gateway), which motivated the naming and the parameter-placeholder handling -- 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]
