1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| # Map UDF,继承ScalarFunction table.map(udf()) table.select(udf1(),udf2(),udf3())
# FlatMap UDTF,继承TableFunction table.flatMap(udtf()) table.joinLateral(udtf())
# Aggregate UDAF,继承AggregateFunction table.aggregate(agg()) table.select(agg1(),agg2()...)
# FlatAggregate UD(TA)F,继承TableAggregateFunction table.groupBy('a') .flatAggregate(flatAggFunc('e,'f) as ('a,'b,'c)) .select('a,'c) 新增Agg,能输出多行
# AggregateFunction & TableAggregateFunction AggregateFunction适合做最大值 TableAggregateFunction可以做TopN
|