You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation only supports CEIL/FLOOR calls when including TO <DateTimeField>. However this syntax appears to be rare and so far I've only found it supported in Kinesis, which isn't supported by sqlparser at all.
The majority of dialects support a single expression, or an expression and a scale separated by a comma:
SELECT CEIL(321.56, 1)
-- prints 321.6SELECT CEIL(321.56)
-- prints 322
Because the CEIL/FLOORexpressions expect a DateTimeField, I'm not sure it makes sense to just pass a numeric literal to this and force into a Custom(Ident) type.
Happy to open a PR for this, but wanted to understand the best way to handle field attribute here.
The text was updated successfully, but these errors were encountered:
Oh that's interesting, I think its a bit strange for the parser to support the CEIL(x TO y) syntax given none of the supported dialects do, looking at the PR discussion it seems it was intentional at the time at least (not sure if its still valid since then) so we could just as well preserve the current syntax.
Yeah I think representing the extra argument as an enum, merging it with the datetime sounds reasonable!
The current implementation only supports
CEIL
/FLOOR
calls when includingTO <DateTimeField>
. However this syntax appears to be rare and so far I've only found it supported in Kinesis, which isn't supported bysqlparser
at all.The majority of dialects support a single expression, or an expression and a scale separated by a comma:
Snowflake
BigQuery
Hive
ClickHouse
DuckDb
MsSql
MySql
Postgres
Redshift
SQLite
The existing impl:
https://github.com/sqlparser-rs/sqlparser-rs/blob/1e209d87415a5adfedccac8cee3e2860122e4acb/src/parser/mod.rs#L1694-L1716
Because the
CEIL
/FLOOR
expressions expect aDateTimeField
, I'm not sure it makes sense to just pass a numeric literal to this and force into aCustom(Ident)
type.Happy to open a PR for this, but wanted to understand the best way to handle
field
attribute here.The text was updated successfully, but these errors were encountered: