-
Notifications
You must be signed in to change notification settings - Fork 4k
[fix](agg) Align complex aggregate null ordering #67439
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
Changes from all 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 |
|---|---|---|
|
|
@@ -616,7 +616,7 @@ struct SingleValueDataComplexType { | |
| } | ||
|
|
||
| bool change_if_less(const IColumn& column, size_t row_num, Arena& arena) { | ||
| if (!has() || column_data->compare_at(0, row_num, column, -1) == 1) { | ||
| if (!has() || column_data->compare_at(0, row_num, column, 1) == 1) { | ||
| change(column, row_num, arena); | ||
| return true; | ||
| } else { | ||
|
|
@@ -625,7 +625,7 @@ struct SingleValueDataComplexType { | |
| } | ||
|
|
||
| bool change_if_less(const Self& to, Arena& arena) { | ||
| if (to.has() && (!has() || column_data->compare_at(0, 0, *to.column_data, -1) == 1)) { | ||
| if (to.has() && (!has() || column_data->compare_at(0, 0, *to.column_data, 1) == 1)) { | ||
|
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. [P1] Version the semantic change before merging old aggregate states This overload merges an already-reduced complex state, but the PR reverses the order used to choose that sole state without creating a compatibility boundary. Both the base and head still advertise BE exec version 13. For example, an old v13 worker computing
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. 这个过去就是错的,fix不考虑兼容了 |
||
| change(to, arena); | ||
| return true; | ||
| } else { | ||
|
|
@@ -634,7 +634,7 @@ struct SingleValueDataComplexType { | |
| } | ||
|
|
||
| bool change_if_greater(const IColumn& column, size_t row_num, Arena& arena) { | ||
| if (!has() || column_data->compare_at(0, row_num, column, -1) == -1) { | ||
| if (!has() || column_data->compare_at(0, row_num, column, 1) == -1) { | ||
| change(column, row_num, arena); | ||
| return true; | ||
| } else { | ||
|
|
@@ -643,7 +643,7 @@ struct SingleValueDataComplexType { | |
| } | ||
|
|
||
| bool change_if_greater(const Self& to, Arena& arena) { | ||
| if (to.has() && (!has() || column_data->compare_at(0, 0, *to.column_data, -1) == -1)) { | ||
| if (to.has() && (!has() || column_data->compare_at(0, 0, *to.column_data, 1) == -1)) { | ||
| change(to, arena); | ||
| return true; | ||
| } else { | ||
|
|
@@ -660,7 +660,7 @@ struct SingleValueDataComplexType { | |
| type == TYPE_AGG_STATE) { | ||
| return false; | ||
| } else { | ||
| return !column_data->compare_at(0, row_num, column, -1); | ||
| return !column_data->compare_at(0, row_num, column, 1); | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
SingleValueDataComplexTypeis also the state for unary complexmin/max, not just the*_bykey. With this +1, nestedColumnNullabletreats NULL as greatest, so[10,NULL]beats[10,5]formax(arr)and loses formin(arr). That conflicts with Doris' documented ARRAY aggregate order (NULL is smallest) and the unchangedmaxmin_array_2expectation. Please keep the aggregate comparator policy consistent with the documented contract (or scope a different hint to the intended*_bypath) and add/update plain, merge, and window coverage.