Seddryck / Tseesecake

Tseesecake is a lightweight proxy for time-series query engines, supporting multiple database engines and storage providers, with a SQL dialect dedicated to time series
https://seddryck.github.io/Tseesecake
Apache License 2.0
2 stars 1 forks source link

Arranger for adding BUCKET BY as projection #60

Closed Seddryck closed 1 year ago

Seddryck commented 1 year ago

This arranger should automatically add the bucket function as a projection and named it based on the Timestamp.

SELECT
    MAX(Forecasted) AS Maximum
FROM
    WindEnergy
BUCKET BY
    WEEK OF YEAR

Should be arranged to

SELECT
        date_trunc('week', Instant) AS Instant,
    MAX(Forecasted) AS Maximum
FROM
    WindEnergy
GROUP BY
    date_trunc('week', Instant) AS Instant