-
Notifications
You must be signed in to change notification settings - Fork 69
perf: Improve axis=1 aggregation performance #2036
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -699,6 +699,9 @@ def visit_ArrayFilter(self, op, *, arg, body, param): | |
| def visit_ArrayMap(self, op, *, arg, body, param): | ||
| return self.f.array(sg.select(body).from_(self._unnest(arg, as_=param))) | ||
|
|
||
| def visit_ArrayReduce(self, op, *, arg, body, param): | ||
| return sg.select(body).from_(self._unnest(arg, as_=param)).subquery() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those other methods output an array, arrayreduce produces a single scalar for each input array, so I don't think we want
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for checking! |
||
|
|
||
| def visit_ArrayZip(self, op, *, arg): | ||
| lengths = [self.f.array_length(arr) - 1 for arr in arg] | ||
| idx = sg.to_identifier(util.gen_name("bq_arr_idx")) | ||
|
|
||
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.
do we have any engine or system tests for these two new ops?
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.
Mostly, relying on existing aggregate axis=1 tests, though have now added some engine tests for the new ops