fix: dense rank should be computed base on rank value and group (#302)

This commit is contained in:
Warren 2024-02-06 18:40:28 -08:00 committed by GitHub
parent 702192420e
commit b87c4d771b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,7 @@
---
'@hyperdx/api': patch
'@hyperdx/app': patch
---
fix: dense rank should be computed base on rank value and group (multi-series
chart)

View file

@ -1589,7 +1589,7 @@ export const queryMultiSeriesChart = async ({
SELECT *, ?(?) OVER (PARTITION BY group) as rank_order_by_value
FROM raw_groups
), final AS (
SELECT *, DENSE_RANK() OVER (ORDER BY rank_order_by_value ?) as rank
SELECT *, DENSE_RANK() OVER (ORDER BY rank_order_by_value ?, group) as rank
FROM groups
)
SELECT *