Repository navigation
Conversation
Submit SQL scripts to a Flink SQL Gateway via its JDBC driver: - main/init SQL from inline script or resource-center file (reuses task-api SqlSourceType enum) - configurable statement separator, leading comment/blank stripping - parameter placeholders supported in jdbc url and scripts - plain JUnit tests, no Mockito Named FLINK_SGW because FLINK_SQL_GATEWAY is too long for the DAG node / task-type picker layout (reuses the Flink family icon).
vue-tsc rejects the task model otherwise; the field is used by the SQL Gateway form and was missing from ITaskParams.
SbloodyS
left a comment
There was a problem hiding this comment.
You should integrate it into flink task plugin.
|
SQL Gateway and the existing Flink SQL path are different runtimes, so this should stay a separate task type.
Same split already exists for Happy to colocate both SPI factories in |
|
I'm -1 on this. |
|
Integrated this into the existing FLINK task plugin, as requested.
Closing this PR. |
|
Closed in favor of #18693. |
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
SqlSourceTypeenum 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 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_SGWinstead of the longerFLINK_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
dolphinscheduler-task-flink-sqlgatewaymodule (FlinkSqlGatewayParameters/FlinkSqlGatewayTask/FlinkSqlGatewayTaskChannel/FlinkSqlGatewayTaskChannelFactory)dolphinscheduler-task-plugin/pom.xmland wire it intodolphinscheduler-task-allFLINK_SGWintask-type-config.yamluse-flink-sqlgateway), format-data serialization, icon fallback (reuseflink.png), locales (en/zh)use-resourcesfield helper gains optionallimit/fieldparameters to support the init-script resource fieldDesign notes:
org.apache.dolphinscheduler.plugin.task.api.enums.SqlSourceType(SCRIPT/FILE) introduced by [Improvement-18019][task-sql] Support SQL from resource file and parameter placeholders #18020, instead of duplicating constantstask-api/commonstayprovidedVerify 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) andFlinkSqlGatewayTaskTest(statement splitting incl. regex-special separators, leading comment/blank stripping)mvn package -pl dolphinscheduler-task-plugin/dolphinscheduler-task-flink-sqlgateway -ambuilds the shaded jar cleanly