Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementation lttb macro function #500

Open
Slach opened this issue Dec 1, 2023 · 3 comments
Open

implementation lttb macro function #500

Slach opened this issue Dec 1, 2023 · 3 comments
Assignees
Labels
p1 Priority 1
Milestone

Comments

@Slach
Copy link
Collaborator

Slach commented Dec 1, 2023

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 Slach added this to the 3.0.0 milestone Dec 1, 2023
@Slach
Copy link
Collaborator Author

Slach commented Apr 1, 2024

if we will implements $lttb(bucket_numbers, x_field, y_field) AS alias FROM $table WHERE $timeFilter

shall transformed to something like that

SELECT alias.1 AS x_field, alias.2 AS y_field FROM (
  SELECT untuple(arrayJoin(lttb(bucket_numbers)(x_field, y_field))) AS alias FROM $table WHERE $timeFilter
) ORDER BY x_field 

@Slach Slach modified the milestones: 3.1.0, 3.2.0 Apr 1, 2024
@Slach Slach added the p2 Priority 2 label May 20, 2024
@Slach Slach changed the title check lttb function application for work check is lttb function applicable and usefull May 27, 2024
@Slach Slach modified the milestones: 3.2.0, 3.3.0 Jun 20, 2024
@Slach Slach modified the milestones: 3.3.0, 3.3.1 Nov 28, 2024
@Slach Slach self-assigned this Dec 2, 2024
@Slach Slach modified the milestones: 3.3.1, 3.4.0 Dec 27, 2024
@Slach
Copy link
Collaborator Author

Slach commented Jan 7, 2025

ok. final use case is show downsampled data which will show outliers

also we need to implements

$lttb(auto,x,y)
and calculate auto as
(($__to - $__from) / $__interval_ms )

@Slach Slach changed the title check is lttb function applicable and usefull implementation lttb macro function Jan 7, 2025
@Slach Slach added p1 Priority 1 and removed p2 Priority 2 labels Jan 27, 2025
@Slach
Copy link
Collaborator Author

Slach commented Feb 3, 2025

$lttb(auto,x,y) AS l_alias FROM $table
shall transform to

SELECT l_alias.1 AS x_field, l_alias.2 AS y_field FROM (
  SELECT untuple(arrayJoin(lttb(bucket_numbers)(x_field, y_field))) AS l_alias FROM $table WHERE $timeFilter
) ORDER BY x_field

Slach added a commit that referenced this issue Feb 5, 2025
…hich will contains more outliers than avg or other kind of aggregation, fix #500

Signed-off-by: Eugene Klimov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 Priority 1
Projects
None yet
Development

No branches or pull requests

1 participant