-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Window exec uses framing iterator and support agg functions in windows #746
Conversation
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.
Overall very good work, definitely an improvement in organization and functionality.
My one overall comment is that this needs a some package-level docs explaining what the various abstractions are supposed to do and how they fit together. This doesn't need to be long, just a couple sentences for each type and a paragraph or two on the big picture. But I still have trouble keeping what each of these abstractions do straight in my head as I read this code.
} | ||
|
||
func (a *unaryAggBase) Resolved() bool { | ||
if _, ok := a.Child.(*expression.Star); ok { |
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.
What's with this? Star is by definition not resolved (should get expanded by some other analyzer rule)
If you want to do it this way, create another Star expression, like AggregateStar to differentiate
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 is copied from the old count code, if we have a resolver it doesn't catch these. should i make an issue?
@@ -83,6 +85,29 @@ func (w *Window) String() string { | |||
return sb.String() | |||
} | |||
|
|||
func (w *Window) PartitionId() (uint64, error) { |
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.
Relatively expensive. If this gets called a lot, should probably cache the result.
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.
how? if i'm keeping a cache of strings to int64 shouldn't i just use the strings as the ID?
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.
i see what you mean now, fixed
ae799fd
to
703afa0
Compare
plan.Window is converted into new WindowIter backed by the framing setup. Codegen unary agg function nodes, including executable and unit testing harness. Rewrite window aggregation functions for framing. More unit tests that will make it easier to debug WindowBlock/Iter Doc comments for the new WindowIter exec stack.
703afa0
to
f90f638
Compare
plan.Window is converted into new WindowIter backed by the framing setup.
Codegen unary agg function nodes, including executable and unit testing
harness. Rewrite window aggregation functions for framing.
More unit tests that will make it easier to debug WindowBlock/Iter
Doc comments for the new WindowIter exec stack.