title: Does timescaledb support window functions?
body: <p>I am trying to use the TimescaleDB extension to compute some continuous aggregates. I have this query which works fine:</p>
  <pre><code>SELECT distinct time_bucket('1 hour', entry_ts) as date_hour,
                  type_id,
                  entry_id,
                  exit_id,
                  count(*) OVER (partition by time_bucket('1 hour', entry_ts), entry_id, exit_id, type_id) AS total,
                  ((count(*) over (partition by time_bucket('1 hour', entry_ts), entry_id, exit_id, type_id)) * 100)::numeric /
                  (count(*) over (partition by time_bucket('1 hour', entry_ts), entry_id)) percentage_of_entry
  FROM transits
  </code></pre>
  <p>When I try to put this inside a continuous aggregate materialized view, I get an error:</p>
  <pre><code>CREATE MATERIALIZED VIEW transits_hourly
              WITH (timescaledb.continuous) AS
  SELECT distinct time_bucket('1 hour', entry_ts) as date_hour,
                  type_id,
                  entry_id,
                  exit_id,
                  count(*) OVER (partition by time_bucket('1 hour', entry_ts), entry_id, exit_id, type_id) AS total,
                  ((count(*) over (partition by time_bucket('1 hour', entry_ts), entry_id, exit_id, type_id)) * 100)::numeric /
                  (count(*) over (partition by time_bucket('1 hour', entry_ts), entry_id)) percentage_of_entry
  FROM transits
  WITH NO DATA
  </code></pre>
  <p>The error I get is:</p>
  <pre><code>ERROR:  invalid continuous aggregate view
  SQL state: 0A000
  </code></pre>
  <p>Does TimescaleDB allow Continuous Aggregates over Partition By time windows?</p>
  <p>I am using TimescaleDB 2.1 on PostgreSQL 12.5.</p>