- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 12:18 AM
Hello
I have a very simple table with time series data with three columns:
- id (long): unique id of signal
- ts (unix timestamp): timestamp of the event in unix timestamp format
- value (double): value of the signal at the given timestamp
For every second there is one entry for each signal.
I want to create a view with 1 minute average of the signals but I am having trouble to get the DictionaryFilters to push down the ts filter:
My view is currently defined like this:
SELECT
to_timestamp(from_unixtime(FLOOR((ts - 1) / 60) * 60 + 60)) AS ts
id,
AVG(value) AS avg
FROM
measurements
GROUP BY
id,
FLOOR((ts - 1) / 60)If I make a select on this view with where filter on signal_id and ts the plan shows that the filter is only pushed down for the id:
DictionaryFilters: [(id#10256L = 1234)]
But I make a query directly on the base table and make the where filter there is is pushed down:
DictionaryFilters: [(id#10917L = 1234), ((ts#10920L >= 1751328000) AND (ts#10920L <= 1751414400))]
I tried to adapt the view to not use group by, but with no success. Everytime I use some sort of AVG() Over or something else, the ts filter is not pushed down anymore.
Is there a way to create a view where I can set filter with where ts between x and x that will be pushed down to the DictionaryFilters?
Thanks
Steffen