eldenmoon commented on code in PR #40697: URL: https://github.com/apache/doris/pull/40697#discussion_r1754468445
########## be/src/vec/aggregate_functions/aggregate_function_collect.cpp: ########## @@ -69,15 +72,21 @@ AggregateFunctionPtr create_aggregate_function_collect_impl(const std::string& n if (which.is_date_or_datetime()) { return do_create_agg_function_collect<Int64, HasLimit, ShowNull>(distinct, argument_types, result_is_nullable); - } else if (which.is_date_v2()) { + } else if (which.is_date_v2() || which.is_ipv4()) { return do_create_agg_function_collect<UInt32, HasLimit, ShowNull>(distinct, argument_types, result_is_nullable); - } else if (which.is_date_time_v2()) { + } else if (which.is_date_time_v2() || which.is_ipv6()) { return do_create_agg_function_collect<UInt64, HasLimit, ShowNull>(distinct, argument_types, result_is_nullable); } else if (which.is_string()) { return do_create_agg_function_collect<StringRef, HasLimit, ShowNull>( distinct, argument_types, result_is_nullable); + } else { + // generic serialize which will not use specializations, ShowNull::value always means array_agg + if constexpr (ShowNull::value) { + return do_create_agg_function_collect<void, HasLimit, ShowNull>( + distinct, argument_types, result_is_nullable); + } } LOG(WARNING) << fmt::format("unsupported input type {} for aggregate function {}", Review Comment: unreachable code? remove ########## be/src/vec/aggregate_functions/aggregate_function_collect.cpp: ########## @@ -69,15 +72,21 @@ AggregateFunctionPtr create_aggregate_function_collect_impl(const std::string& n if (which.is_date_or_datetime()) { return do_create_agg_function_collect<Int64, HasLimit, ShowNull>(distinct, argument_types, result_is_nullable); - } else if (which.is_date_v2()) { + } else if (which.is_date_v2() || which.is_ipv4()) { return do_create_agg_function_collect<UInt32, HasLimit, ShowNull>(distinct, argument_types, result_is_nullable); - } else if (which.is_date_time_v2()) { + } else if (which.is_date_time_v2() || which.is_ipv6()) { return do_create_agg_function_collect<UInt64, HasLimit, ShowNull>(distinct, argument_types, result_is_nullable); } else if (which.is_string()) { return do_create_agg_function_collect<StringRef, HasLimit, ShowNull>( distinct, argument_types, result_is_nullable); + } else { + // generic serialize which will not use specializations, ShowNull::value always means array_agg + if constexpr (ShowNull::value) { + return do_create_agg_function_collect<void, HasLimit, ShowNull>( + distinct, argument_types, result_is_nullable); + } } LOG(WARNING) << fmt::format("unsupported input type {} for aggregate function {}", Review Comment: unreachable code? remove -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org