ClickHouse: Aggregating Latest Values, Take Two

Taking the latest value of a timeseries is, from ClickHouse’s point of view, just a form of aggregation. In an earlier blog I showed how to set up an ingestion pipeline that continually updates the latest values to an AggregatingMergeTree table. This is a common requirement in analyzing IoT data. But recently I encountered an interesting variant of this use case: That customer wanted to show, for…