apache / apache/dolphinscheduler
[DSIP-89][SqlTask] Avoid using PrepareStatement in SqlTask
- Dominant language
- Java
- Stars
- 14.5k
- Forks
- 5.1k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 29
Description
### Search before asking
- [x] I had searched in the [DSIP](https://github.com/apache/dolphinscheduler/issues/14102) and found no similar DSIP.
### Motivation
Right now we're using PrepareStatement in SqlTask, and if we find the sql contains `${xx}` will using `?` to replase `${xx}` and set the value in `PrepareStatement`.
There might exist a lot of bug in this way, some are from DS, some are from third-part driver.
e.g. #17124
So it's better to directly replace the value in sql rather than using Preparement.
### Design Detail
_No response_
### Compatibility, Deprecation, and Migration Plan
_No response_
### Test Plan
_No response_
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Contributor guide
Research direction
Start at the SqlTask implementation and trace where PrepareStatement handles SQL containing ${xx}; review issue #17124 for the reported failure mode. Clarify how values should be replaced before changing the execution path, then verify that affected SQL runs correctly without PrepareStatement and that existing SqlTask behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- backend, databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100