-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[refactor](array-type) optimize the array_distinct and array_sort fun… #11306
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
Conversation
xy720
left a comment
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.
There are still much duplicate code between function_array_sort.cpp and function_array_distinct.cpp. Is there any good idea to extract these code out?
| } | ||
|
|
||
| auto res_val = | ||
| Impl::_execute_by_type(*src_nested_column, src_offsets, *dest_nested_column, |
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.
| Impl::_execute_by_type(*src_nested_column, src_offsets, *dest_nested_column, | |
| Impl::execute(*src_nested_column, src_offsets, *dest_nested_column, |
I think execute is better. Because we may be add a function in future which don't need to classify the execute by type.
| static bool _execute_string(const IColumn& src_column, const ColumnArray::Offsets& src_offsets, | ||
| IColumn& dest_column, ColumnArray::Offsets& dest_offsets, | ||
| const NullMapType* src_null_map, NullMapType* dest_null_map) { | ||
| const ColumnString* src_data_concrete = reinterpret_cast<const ColumnString*>(&src_column); |
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.
Duplicate with function_array_distinct.cpp
If it is hard to add an abstract method, you can put the duplicate code into function_array_utils.h and use a common util method instead.
| return false; | ||
| } | ||
|
|
||
| ColumnString& dest_column_string = reinterpret_cast<ColumnString&>(dest_column); |
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.
Duplicate too.
ok,I will re-check again. |
36f8583 to
6a22613
Compare
6a22613 to
2e53fa5
Compare
Proposed changes
Issue Number: close #10052
Problem Summary:
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...