-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
“toDate”函数经过解析之后变成了大写“TODATE”,数据库不识别 #998
Comments
这个可能是变量处理逻辑的问题,方便提供你在数据视图页面编写的SQL吗? |
我看你的SQL里面已经用了toDate函数了,那 |
明白问题所在了,目前SQL处理确实会修改函数的大小写,这个需要优化。 另外你的场景目前可以尝试用两种方式看能不能正常工作。 方式1、把变量里的toDate函数去掉,直接写变量,然后变量定义为日期类型。 方式2,SQL保持现有写法,然后把两个变量都定义为表达式类型。 |
目前有一种情况可以运行,就是变量定义为表达式类型,sql 里的toDate也去掉,这样数据视图和仪表盘关联日期筛选的时候都不会报错。 |
好的,这个问题我们会尽快修复。 |
感谢,另外这个toDate引申出另一个问题,我用toDate再去转换的原因是: |
Datart版本号
1.0.0.beta.2
错误描述
“toDate”函数经过解析之后变成了大写“TODATE”,数据库不识别
如何重现
重现错误的步骤,例如:
截图
`
2022-03-14 16:57:48.151 ERROR datart.server.config.WebExceptionHandler : ClickHouse exception, code: 1002, host: 116.-.6.-, port: -; Code: 46. DB::Exception: Unknown function TODATE. Maybe you meant: ['toDate','toDate32']: While processing SELECT dt FROM dim.dim_pub_date WHERE (dt >= TODATE(toDateTime('2022-02-12 00:00:00'))) AND (dt <= TODATE('2022-03-15 00:00:00')). (UNKNOWN_FUNCTION) (version 21.9.2.17 (official build))
ru.yandex.clickhouse.except.ClickHouseUnknownException: ClickHouse exception, code: 1002, host: 116.-.6.-, port: -; Code: 46. DB::Exception: Unknown function TODATE. Maybe you meant: ['toDate','toDate32']: While processing SELECT dt FROM dim.dim_pub_date WHERE (dt >= TODATE(toDateTime('2022-02-12 00:00:00'))) AND (dt <= TODATE('2022-03-15 00:00:00')). (UNKNOWN_FUNCTION) (version 21.9.2.17 (official build))
Caused by: java.lang.Throwable: Code: 46. DB::Exception: Unknown function TODATE. Maybe you meant: ['toDate','toDate32']: While processing SELECT dt FROM dim.dim_pub_date WHERE (dt >= TODATE(toDateTime('2022-02-12 00:00:00'))) AND (dt <= TODATE('2022-03-15 00:00:00')). (UNKNOWN_FUNCTION) (version 21.9.2.17 (official build))
`
运行环境详情:(可选,取决于错误发生的具体位置)
The text was updated successfully, but these errors were encountered: