You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "jayzhan211 (via GitHub)" <gi...@apache.org> on 2024/11/11 06:20:33 UTC
Re: [PR] support to_timestamp with optional chrono formats [datafusion]
jayzhan211 commented on PR #8886:
URL: https://github.com/apache/datafusion/pull/8886#issuecomment-2467332555
@Omega359 Do you know why `to_timestamp` has more than 2 arguments? What behaviour does this function follow?
In Postgres, there are two arguments
```
to_timestamp ( text, text ) → timestamp with time zone
Converts string to time stamp according to the given format. (See also to_timestamp(double precision) in [Table 9.33](https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TABLE).)
to_timestamp('05 Dec 2000', 'DD Mon YYYY') → 2000-12-05 00:00:00-05
```
```
to_timestamp ( double precision ) → timestamp with time zone
Convert Unix epoch (seconds since 1970-01-01 00:00:00+00) to timestamp with time zone
to_timestamp(1284352323) → 2010-09-13 04:32:03+00
```
Can I change the signature to be consistent with Postgres one?
https://github.com/apache/datafusion/blob/7ebd993fe47e78006bad33256160716f73b13cef/datafusion/sqllogictest/test_files/timestamps.slt#L362-L366
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org