ARRAY_AGGREGATE (Lakehouse v1)
Agrège les éléments du tableau avec une fonction d’agrégation.
Syntaxe Analyze
Section intitulée « Syntaxe Analyze »func.array_aggregate( <array>, '<agg_func>' )-
Les fonctions d’agrégation prises en charge incluent
avg,count,max,min,sum,any,stddev_samp,stddev_pop,stddev,std,median,approx_count_distinct,kurtosisetskewness. -
La syntaxe peut être réécrite sous la forme
func.array_<agg_func>( <array> ). Par exemple,func.array_avg( <array> ).
Exemples Analyze
Section intitulée « Exemples Analyze »func.array_aggregate([1, 2, 3, 4], 'sum'), func.array_sum([1, 2, 3, 4])
┌──────────────────────────────────────────────────────────────────────────┐│ func.array_aggregate([1, 2, 3, 4], 'sum') │ func.array_sum([1, 2, 3, 4])│├────────────────────────────────────────────┼─────────────────────────────┤│ 10 │ 10 │└──────────────────────────────────────────────────────────────────────────┘Syntaxe SQL
Section intitulée « Syntaxe SQL »ARRAY_AGGREGATE( <array>, '<agg_func>' )-
Les fonctions d’agrégation prises en charge incluent
avg,count,max,min,sum,any,stddev_samp,stddev_pop,stddev,std,median,approx_count_distinct,kurtosisetskewness. -
La syntaxe peut être réécrite sous la forme
ARRAY_<agg_func>( <array> ). Par exemple,ARRAY_AVG( <array> ).
Exemples SQL
Section intitulée « Exemples SQL »SELECT ARRAY_AGGREGATE([1, 2, 3, 4], 'SUM'), ARRAY_SUM([1, 2, 3, 4]);
┌────────────────────────────────────────────────────────────────┐│ array_aggregate([1, 2, 3, 4], 'sum') │ array_sum([1, 2, 3, 4]) │├──────────────────────────────────────┼─────────────────────────┤│ 10 │ 10 │└────────────────────────────────────────────────────────────────┘