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

fix(discover): Fix has:measurements.* queries #78627

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Oct 4, 2024

Fixes SENTRY-3DB9

We're seeing Snuba errors for comparisons of a numeric value to a string. e.g.,

`measurements.frames_frozen_rate` != ''

Measurements are numeric, so this errors out. This comparison is created for queries like has:measurements.frozen_frame_rate. That measurement is "synthetic", it's a function that divides two other measurements. It returns a numeric value, so comparison to string fails. The query builder's current logic doesn't account for measurement functions, and creates the comparison incorrectly.

The attempted fix is to check for measurements, and return early with a basic check for null.

A measurement is nullable, but is not a column. The current logic falls
through, and creates a string comparison condition. Since measurements
are numeric, this fails in ClickHouse. Instead, queries for presence of
a measurement should use a simple `"isNull"` condition.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 4, 2024
@gggritso gggritso marked this pull request as ready for review October 4, 2024 18:37
@gggritso gggritso requested review from a team as code owners October 4, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants