-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 bug in initializing global aggregations with initialized flag #9396
Conversation
This pull request was exported from Phabricator. Differential Revision: D55823098 |
✅ Deploy Preview for meta-velox canceled.
|
…cebookincubator#9396) Summary: facebookincubator#9067 introduced an initialized flag that we include alongside the null flag for aggregations in the rows in RowContainer. Global aggregations do not use a RowContainer to create rows, rather a single row is constructed manually inside GroupingSets. When that PR was landed this logic was not properly updated, we did not allocate enough space in the row for the additional bits which could lead to null/initialized flags overwriting the aggregate values when there were a lot of them. This change fixes it so that we allocate the correct amount of space for flags for global aggregations as an immediate fix. Longer term it would be better to centralize the logic for creating rows in RowContainer (I'd like to get us back to a working state before attempting such a refactor). Differential Revision: D55823098
fef41b5
to
cd6970e
Compare
This pull request was exported from Phabricator. Differential Revision: D55823098 |
…cebookincubator#9396) Summary: facebookincubator#9067 introduced an initialized flag that we include alongside the null flag for aggregations in the rows in RowContainer. Global aggregations do not use a RowContainer to create rows, rather a single row is constructed manually inside GroupingSets. When that PR was landed this logic was not properly updated, we did not allocate enough space in the row for the additional bits which could lead to null/initialized flags overwriting the aggregate values when there were a lot of them. This change fixes it so that we allocate the correct amount of space for flags for global aggregations as an immediate fix. Longer term it would be better to centralize the logic for creating rows in RowContainer (I'd like to get us back to a working state before attempting such a refactor). Differential Revision: D55823098
cd6970e
to
967a981
Compare
This pull request was exported from Phabricator. Differential Revision: D55823098 |
…cebookincubator#9396) Summary: facebookincubator#9067 introduced an initialized flag that we include alongside the null flag for aggregations in the rows in RowContainer. Global aggregations do not use a RowContainer to create rows, rather a single row is constructed manually inside GroupingSets. When that PR was landed this logic was not properly updated, we did not allocate enough space in the row for the additional bits which could lead to null/initialized flags overwriting the aggregate values when there were a lot of them. This change fixes it so that we allocate the correct amount of space for flags for global aggregations as an immediate fix. Longer term it would be better to centralize the logic for creating rows in RowContainer (I'd like to get us back to a working state before attempting such a refactor). Differential Revision: D55823098
967a981
to
2f53976
Compare
This pull request was exported from Phabricator. Differential Revision: D55823098 |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
This pull request has been merged in e0ef5a2. |
|
||
// Allocate space for the null and initialized flags. | ||
int32_t rowSizeOffset = | ||
bits::nbytes(aggregates_.size() * RowContainer::kNumAccumulatorFlags); |
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.
Hi @kevinwilfong , seems the flags don't consider for sortedAggregations_
and distinctAggregations_
? cc @Yuhta @mbasmanova
…cebookincubator#9396) Summary: Pull Request resolved: facebookincubator#9396 facebookincubator#9067 introduced an initialized flag that we include alongside the null flag for aggregations in the rows in RowContainer. Global aggregations do not use a RowContainer to create rows, rather a single row is constructed manually inside GroupingSets. When that PR was landed this logic was not properly updated, we did not allocate enough space in the row for the additional bits which could lead to null/initialized flags overwriting the aggregate values when there were a lot of them. This change fixes it so that we allocate the correct amount of space for flags for global aggregations as an immediate fix. Longer term it would be better to centralize the logic for creating rows in RowContainer (I'd like to get us back to a working state before attempting such a refactor). Reviewed By: Yuhta Differential Revision: D55823098 fbshipit-source-id: 9a15f257669273c64dc0361bf735c4472e45957d
Summary:
#9067 introduced an initialized flag that we include alongside the null flag
for aggregations in the rows in RowContainer.
Global aggregations do not use a RowContainer to create rows, rather a single row is constructed manually inside
GroupingSets. When that PR was landed this logic was not properly updated, we did not allocate enough space in the row
for the additional bits which could lead to null/initialized flags overwriting the aggregate values when there were a lot of
them.
This change fixes it so that we allocate the correct amount of space for flags for global aggregations as an immediate fix.
Longer term it would be better to centralize the logic for creating rows in RowContainer (I'd like to get us back to a working
state before attempting such a refactor).
Differential Revision: D55823098