-
Notifications
You must be signed in to change notification settings - Fork 98
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
Tests for cumulative metrics queried with non-default granularities #1284
Conversation
328dfb3
to
2177713
Compare
ae72a15
to
0c64b86
Compare
72912f4
to
bb01173
Compare
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.
, FIRST_VALUE(revenue_mtd) OVER ( | ||
PARTITION BY revenue_instance__ds__quarter, revenue_instance__ds__year | ||
ORDER BY metric_time__day | ||
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING |
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.
Whoa, all of this works on all engines?
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.
This SQL rendering logic already existed for conversion metrics, so it should!
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.
And also SQL engine & check query tests pass, so yes.
SELECT | ||
revenue_instance__ds__quarter | ||
, revenue_instance__ds__year | ||
, FIRST_VALUE(revenue_mtd) OVER ( |
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.
Oh this is interesting. If it's month to date and people truncate to year that's super strange, right? It's just always month to date for January or whatever? I guess the answer is "don't do that" - but I do wonder if we should have a different default from FIRST_VALUE - I guess people can eventually override it to LAST_VALUE (which might be more sensible).
0c64b86
to
568d048
Compare
16093de
to
3cd9aa2
Compare
Tests!!