mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-18 01:37:15 +00:00
Support expression in AT TIME ZONE and fix precedence (#1272)
This commit is contained in:
parent
9d15f7e9a9
commit
d5faf3c54b
4 changed files with 65 additions and 53 deletions
|
@ -584,7 +584,7 @@ pub enum Expr {
|
|||
/// AT a timestamp to a different timezone e.g. `FROM_UNIXTIME(0) AT TIME ZONE 'UTC-06:00'`
|
||||
AtTimeZone {
|
||||
timestamp: Box<Expr>,
|
||||
time_zone: String,
|
||||
time_zone: Box<Expr>,
|
||||
},
|
||||
/// Extract a field from a timestamp e.g. `EXTRACT(MONTH FROM foo)`
|
||||
///
|
||||
|
@ -1270,7 +1270,7 @@ impl fmt::Display for Expr {
|
|||
timestamp,
|
||||
time_zone,
|
||||
} => {
|
||||
write!(f, "{timestamp} AT TIME ZONE '{time_zone}'")
|
||||
write!(f, "{timestamp} AT TIME ZONE {time_zone}")
|
||||
}
|
||||
Expr::Interval(interval) => {
|
||||
write!(f, "{interval}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue