apache / apache/doris-spark-connector
[Bug] get query plan failed when where clause contains datetime/date type
- Dominant language
- Java
- Stars
- 107
- Forks
- 126
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 4
Description
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
### Version
25.0.1
### What's Wrong?
Get query plan failed when `where` clause contains datetime/date type because of incorrect sql.
origin sql:
`col("statisticsDate") >= date_sub(to_date(lit(DateUtils.getYesterday)), 30)`
exception:

### What You Expected?
generate the correct sql to get query plan when contains datetime/date type.
### How to Reproduce?
_No response_
### Anything Else?
_No response_
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### 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 with the SQL-generation path for the expression shown in issue #291 and inspect the reported exception for how datetime/date literals are rendered. Reproduce the query-plan request if possible, then verify that the generated SQL is valid and that a regression check covers the date_sub/to_date expression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spark
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100