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

Respect keyed parameter in percentile_ranks aggr #57

Merged
merged 3 commits into from
May 8, 2024

Conversation

trzysiek
Copy link
Member

@trzysiek trzysiek commented May 7, 2024

Before: dashboard is broken. We don't respect keyed, and return response in incorrect format. I've already fixed it for 2 other aggregations.

Not sure why, but I didn't add a test for this aggregation, so we had none. Now we have 1 😆
Screenshot 2024-05-08 at 00 15 39
Screenshot 2024-05-08 at 00 15 14
After:
Screenshot 2024-05-08 at 18 52 39

@trzysiek trzysiek force-pushed the percentile-ranks-keyed branch 2 times, most recently from 0fdd815 to a66713e Compare May 8, 2024 16:46
@trzysiek trzysiek force-pushed the percentile-ranks-keyed branch from a66713e to a739555 Compare May 8, 2024 17:02
@trzysiek trzysiek marked this pull request as ready for review May 8, 2024 17:03
@trzysiek trzysiek requested a review from a team as a code owner May 8, 2024 17:03
@trzysiek trzysiek requested review from nablaone, jakozaur, mieciu, pivovarit and pdelewski and removed request for a team May 8, 2024 17:03
@trzysiek trzysiek enabled auto-merge (squash) May 8, 2024 17:03
} else {
cutValue = cutValue[:dot+3]
if len(rows) == 0 {
logger.WarnWithCtx(query.ctx).Msg("no rows in percentile ranks response")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it even warn, it might be valid response for zero results.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noo, the query always looks like the one in the test:

"SELECT toInt64(toUnixTimestamp64Milli(`timestamp`)/3600000), " +
				`count(if("AvgTicketPrice"<=0.000000, 1, NULL))/count(*)*100, ` +
				`count(if("AvgTicketPrice"<=50000.000000, 1, NULL))/count(*)*100 ` +
				`FROM ` + testdata.QuotedTableName + `  ` +
				"GROUP BY (toInt64(toUnixTimestamp64Milli(`timestamp`)/3600000)) " +
				"ORDER BY (toInt64(toUnixTimestamp64Milli(`timestamp`)/3600000))",

So 0 rows is bad. Maybe it's even worth making the check as == 1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks for explanation.

@trzysiek trzysiek merged commit 62e6b30 into main May 8, 2024
4 checks passed
@trzysiek trzysiek deleted the percentile-ranks-keyed branch May 8, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants