Altinity / clickhouse-grafana

Altinity Grafana datasource plugin for ClickHouse®
MIT License
713 stars 120 forks source link

check is `lttb` function applicable and usefull #500

Open Slach opened 9 months ago

Slach commented 9 months ago

Would be very cool would be to have an option to use the new lttb function in 23.10 for the downsampling. This could be an option to select in the plugin settings and/or maybe a completely new macro?

https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/largestTriangleThreeBuckets

Slach commented 5 months ago

if we will implements $lttb(bucket_numbers, field1, field2)

shall transformed to something like that

WITH largestTriangleThreeBuckets(4)(field1, field2) AS lttb
SELECT untuple(arrayJoin(lttb)) FROM $table;