cube
cube copied to clipboard
Preaggregations partitions are only built for query dateranges instead of the partition granularity.
When running a query that has pre-aggregations defined with
partition_granularity: 'quarter', granularity: 'day'.
I.e.
Query with timedimension ['2023-11-01', '2023-12-05'], it will build preaggregation with '2023_10_01' partition but that parition is only built for 2023_10_01 to 2023_12_05 instead of 2023_10_01 to 2023_12_31.
Now I try to query with timedimension ['2023-11-01', '2023-12-15'], it will still use the same partition which gives wrong data as it only has data upto '2023_12_05'.
Let me know if you need more details for the same.
@gauravbodara It's by design. The rationale behind that is whenever you're using lambda querying, you need to know the exact point in time where to cut data. Otherwise, it gets duplicated. So you should make sure you're setting your build range correctly to include data if you have in future dates for example.
@paveltiunov Got the idea for Lambda, for the above example I have build_range_end as NOW() which is the current date, But If I query using 15-01-2024 to 28-01-2024, Preagg is only created for that till the 28-01-2024 instead of the current date which is '17-02-2024'.
While using lambda,
- will it create a new preagg with lambda?
- and serve query from that if I query with
02-02-2024 to 17-02-2024, which is of same partition but data is not built in the preagg,
Let me know your thoughts on the above and if you need more details I can share them.
@gauravbodara Could you please share the exact pre-aggregation definition that you have?