[feature-wip](array-type) add agg function collect_list and collect_set (#10606)
add codes for collect_list and collect_set and update regression output, before output format for ARRAY(string) already changed. Co-authored-by: cambyzju <zhuxiaoli01@baidu.com>
This commit is contained in:
@ -855,6 +855,8 @@ public class FunctionSet<T> {
|
||||
//TODO(weixiang): is quantile_percent can be replaced by approx_percentile?
|
||||
public static final String QUANTILE_PERCENT = "quantile_percent";
|
||||
public static final String TO_QUANTILE_STATE = "to_quantile_state";
|
||||
public static final String COLLECT_LIST = "collect_list";
|
||||
public static final String COLLECT_SET = "collect_set";
|
||||
|
||||
private static final Map<Type, String> ORTHOGONAL_BITMAP_INTERSECT_INIT_SYMBOL =
|
||||
ImmutableMap.<Type, String>builder()
|
||||
@ -2215,6 +2217,16 @@ public class FunctionSet<T> {
|
||||
prefix + "26percentile_approx_finalizeEPN9doris_udf15FunctionContextERKNS1_9StringValE",
|
||||
false, true, false, true));
|
||||
|
||||
// collect_list
|
||||
Type[] arraySubTypes = {Type.BOOLEAN, Type.SMALLINT, Type.TINYINT, Type.INT, Type.BIGINT, Type.LARGEINT,
|
||||
Type.FLOAT, Type.DOUBLE, Type.DATE, Type.DATETIME, Type.DECIMALV2, Type.VARCHAR, Type.STRING};
|
||||
for (Type t : arraySubTypes) {
|
||||
addBuiltin(AggregateFunction.createBuiltin(COLLECT_LIST, Lists.newArrayList(t), new ArrayType(t), t,
|
||||
"", "", "", "", "", true, false, true, true));
|
||||
addBuiltin(AggregateFunction.createBuiltin(COLLECT_SET, Lists.newArrayList(t), new ArrayType(t), t,
|
||||
"", "", "", "", "", true, false, true, true));
|
||||
}
|
||||
|
||||
// Avg
|
||||
// TODO: switch to CHAR(sizeof(AvgIntermediateType) when that becomes available
|
||||
addBuiltin(AggregateFunction.createBuiltin("avg",
|
||||
|
||||
Reference in New Issue
Block a user