caiconghui commented on a change in pull request #8680:
URL: https://github.com/apache/incubator-doris/pull/8680#discussion_r838110778
##########
File path: be/src/olap/aggregate_func.h
##########
@@ -98,13 +98,28 @@ struct BaseAggregateFuncs {
if (src_null) {
return;
}
- if constexpr (field_type == OLAP_FIELD_TYPE_ARRAY) {
- auto _type_info = get_collection_type_info(sub_type);
- _type_info->deep_copy(dst->mutable_cell_ptr(), src, mem_pool);
- } else {
- // get type at compile time for performance
- auto _type_info = get_scalar_type_info<field_type>();
- _type_info->deep_copy(dst->mutable_cell_ptr(), src, mem_pool);
+ const auto* type_info = get_scalar_type_info<field_type>();
+ type_info->deep_copy(dst->mutable_cell_ptr(), src, mem_pool);
+ }
+
+ // Default update do nothing.
+ static void update(RowCursorCell* dst, const RowCursorCell& src, MemPool*
mem_pool) {}
+
+ // Default finalize do nothing.
+ static void finalize(RowCursorCell* src, MemPool* mem_pool) {}
+};
+
+template <FieldType sub_type>
+struct BaseAggregateFuncs<OLAP_FIELD_TYPE_ARRAY, sub_type> {
+ static void init(RowCursorCell* dst, const char* src, bool src_null,
MemPool* mem_pool,
+ ObjectPool* agg_pool) {
+ dst->set_is_null(src_null);
+ if (src_null) {
+ return;
+ }
+ if (sub_type != OLAP_FIELD_TYPE_ARRAY) {
Review comment:
origin implementation not support collection<ARRAY>, because need more
detail info
--
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]