amorynan commented on code in PR #24327:
URL: https://github.com/apache/doris/pull/24327#discussion_r1327096641
##########
be/src/vec/functions/array/function_array_union.cpp:
##########
@@ -31,41 +32,46 @@ struct NameArrayUnion {
static constexpr auto name = "array_union";
};
-template <typename Set, typename Element>
+template <typename Map, typename ColumnType>
struct UnionAction {
- // True if set has null element
- bool null_flag = false;
+ // True if current has null element
+ bool current_null_flag = false;
// True if result_set has null element
bool result_null_flag = false;
// True if it should execute the left array first.
- static constexpr auto execute_left_column_first = true;
+ typename Map::mapped_type* value = nullptr;
// Handle Null element.
- // Return true means this null element should put into result column.
- template <bool is_left>
- bool apply_null() {
- if (!null_flag) {
- null_flag = true;
- return true;
- }
- return false;
- }
+ bool apply_null() { return result_null_flag; }
// Handle Non-Null element.
- // Return ture means this Non-Null element should put into result column.
- template <bool is_left>
- bool apply(Set& set, Set& result_set, const Element& elem) {
- if (!set.find(elem)) {
- set.insert(elem);
- return true;
+ void apply(Map& map, const int arg_idx, const int row_idx,
Review Comment:
maybe size_t is better ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]