-
Notifications
You must be signed in to change notification settings - Fork 235
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
Refactor the aggregate API [databricks] #3910
Merged
abellina
merged 6 commits into
NVIDIA:branch-21.12
from
abellina:agg/agg_function_refactor
Oct 29, 2021
Merged
Refactor the aggregate API [databricks] #3910
abellina
merged 6 commits into
NVIDIA:branch-21.12
from
abellina:agg/agg_function_refactor
Oct 29, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Alessandro Bellina <abellina@nvidia.com>
Signed-off-by: Alessandro Bellina <abellina@nvidia.com>
abellina
changed the title
Refactor the aggregate API
Refactor the aggregate API [databricks]
Oct 25, 2021
build |
sameerz
added
the
task
Work required that improves the product but is not user facing
label
Oct 25, 2021
Build failure appears (?) unrelated:
Investigating.. |
Filed this one to track: #3911 |
build |
revans2
reviewed
Oct 27, 2021
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.
Not 100% done yet, but overall it is looking good.
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/AggregateFunctions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/AggregateFunctions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/AggregateFunctions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/AggregateFunctions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/AggregateFunctions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/AggregateFunctions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/AggregateFunctions.scala
Outdated
Show resolved
Hide resolved
Thanks @revans2 I believe I have addressed your comments. |
build |
revans2
approved these changes
Oct 29, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supersedes #3833
Closes #3194
Closes #3442
This refactor of the aggregate code does the following:
Simplify
setupReferences
to follow what Spark does. Spark has aninputAttributes
val that they pass to the iterators that handles the special cases we were handling in our code, so I've replaced the (rather large) special casing insetupReferences
with Spark's approach, added a couple of code references in the code to make it easier to follow.Refactors
computeAggregate
by treating the aggregate component, reduction or group by the same. There's always a pre and post step around the cuDF aggregate. AnAggHelper
class was introduced to encapsulate and break up the code incomputeAggregate
.The aggregate functions themselves changed.
CudfAggregate
is no longer an expression. The invocation of cuDF aggregates is simply done by ordinals (as it was done before, but now the ordinals come from theAggHelper
and are handled the same for reductions and group by. The attribute references were cleaned to try and address @revans2's concerns called out here: Remove the special reduction cast in hash aggregate #3833 (comment).