NXP-14879: use generics for bucket type
NXP-14879: impl date range aggregate