paradedb / pg_analytics

DuckDB-powered analytics for Postgres
https://paradedb.com
PostgreSQL License
197 stars 13 forks source link

Add support for time_bucket() in ParadeDB pg_lakehouse #52

Closed od0 closed 2 months ago

od0 commented 3 months ago

What feature are you requesting?

A time_bucket() function for pg_lakehouse queries.

Why are you requesting this feature?

There are some helpful functions in DuckDB when working with timeseries data (https://duckdb.org/docs/sql/functions/date.html). In particular, time_bucket() comes in quite handy. TimescaleDB also has this and has a nice writeup explaining it (https://docs.timescale.com/api/latest/hyperfunctions/time_bucket/).

What is your proposed implementation for this feature?

I'm not acquainted well enough yet with ParadeDB to propose an implementation, just hopeful that it could be added for queries that are pushed down to DuckDB.

Full Name:

Bryan Russett

Affiliation:

Caurus

philippemnoel commented 3 months ago

Hey Bryan! Thanks for bringign this up. We'll likely need to expose some DuckDB syntax here. This is a bit lower priority, but likely something we can get to in a few weeks. Apologies for the delays

devanbenz commented 3 months ago

@philippemnoel please let me know if I can take this one on as well? It will correspond with some of the research I've been doing within duckdb internals too :) I may not be able to get to it until later tonight or sometime during this week (since vacation) but I can likely sneak away and get on my laptop again 😆

philippemnoel commented 3 months ago

Go ahead, would love for you to take it :)