qiuyanjun888 opened a new pull request, #18396:
URL: https://github.com/apache/dolphinscheduler/pull/18396
## Purpose
Fix #17263
Render SQL task custom parameters locally before submitting SQL through JDBC
`Statement`, avoiding `PreparedStatement` for SQL text that already contains
DolphinScheduler parameter syntax.
## Changes
- Add a SQL task local parameter renderer for `${name}` and `!{name}`
placeholders.
- Render normal `${name}` placeholders as SQL literals by default, including
escaping string-like values and validating typed literals.
- Preserve raw `!{name}` replacement for trusted SQL fragments without
rescanning rendered replacement text.
- Use JDBC `Statement` to execute rendered SQL in `SqlTask`.
- Document SQL task parameter rendering rules and raw replacement
constraints.
- Add regression coverage for identifier fragments, list values, quoted
strings, raw fragments, malformed typed literals, and Statement execution.
## Tests
- `./mvnw -pl dolphinscheduler-task-plugin/dolphinscheduler-task-sql -am
-DskipUT=false -DskipITs -DskipE2E -Dcheckstyle.skip -Dspotless.check.skip
-Djacoco.skip=true -Dsurefire.failIfNoSpecifiedTests=false -Dtest=SqlTaskTest
test`
- `./mvnw -pl dolphinscheduler-task-plugin/dolphinscheduler-task-sql -am
spotless:apply`
- `git diff --check`
--
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]