-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Datafusion supports a few date parts like "year" or "seconds" in the EXTRACT operator.
Postgres offers a few more. In particular it offers an EPOCH date part which extracts the number of seconds since 1970-01-01 00:00:00-00 (can be negative).
See https://www.postgresql.org/docs/8.1/functions-datetime.html
My particular use case is using pre-existing grafana postgres plugin, which crafts queries with such a construct. But I think it would be generally useful to support converting a timestamp to a unix epoch.
Describe the solution you'd like
select EXTRACT(EPOCH from column) from mytable;Describe alternatives you've considered
select CAST(column AS bigint)/1000000000 from mytable;mjvankampen
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers