sgrebnov opened a new issue, #21294: URL: https://github.com/apache/datafusion/issues/21294
As discussed [here](https://github.com/apache/datafusion/pull/21103#issuecomment-4137545691) the unparser default behavior is to use `DateTime<Tz>.to_string()` to unparse timestamp with time zone values, which produce literals not supported by multiple dialects (eg `DuckDB`, `BigQuery`). We should switch to `DateTime<Tz>.to_rfc3339` as the default formatting, which produces a valid ISO 8601 / RFC 3339 timestamp string and is more broadly compatible across dialects. ``` /// Returns an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`. #[cfg(feature = "alloc")] #[must_use] pub fn to_rfc3339(&self) -> String { // For some reason a string with a capacity less than 32 is ca 20% slower when benchmarking. let mut result = String::with_capacity(32); let naive = self.overflowing_naive_local(); let offset = self.offset.fix(); write_rfc3339(&mut result, naive, offset, SecondsFormat::AutoSi, false) .expect("writing rfc3339 datetime to string should never fail"); result } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
