-
Notifications
You must be signed in to change notification settings - Fork 94
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(spans): Apply max. SQL expression depth after simplification #3003
Conversation
relay-event-normalization/src/normalize/span/description/sql/parser.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 makes sense, though I guess we're losing the (
and )
that used to surround collapsed conditions, is that right?
…arser.rs Co-authored-by: Oleksandr <1931331+olksdr@users.noreply.github.com>
@gggritso Yes, we're losing that. Because this normalization is quite general, there might also be a bunch of other cases where we now remove parentheses, i.e. there will be grouping changes. If you feel strongly about I can revert this part, but it will result in duplicate groups for the case we're trying to fix. |
@jjbayer 🚢 👍🏻 |
Repeating OR/AND conditions are collapsed, but if the maximum query depth is reached, the limit is applied before we can collapse it. This leads to scrubbed queries like:
Fix by splitting the query visitor into two steps (first normalize, then reduce depth).
This PR also removes redundant parentheses around binary operations (e.g.
a OR (b OR c)
).ref: internal issue