Impala 聚合函数和分析函数

版本:impala 3.2

impala 支持的聚合函数如下:

APPX_MEDIAN
AVG
COUNT
SUM
GROUP_CONCAT
MAX
MIN
NDV
STDDEV, STDDEV_SAMP, STDDEV_POP
VARIANCE, VARIANCE_SAMP, VARIANCE_POP, VAR_SAMP, VAR_POP

impala支持的分析函数:

Analytic functions (also known as window functions) 

over语句的语法:

function(args) OVER([partition_by_clause] [order_by_clause [window_clause]])

partition_by_clause ::= PARTITION BY expr [, expr ...]
order_by_clause ::= ORDER BY expr  [ASC | DESC] [NULLS FIRST | NULLS LAST] [, expr [ASC | DESC] [NULLS FIRST | NULLS LAST] ...]

 windows语句的语法:

ROWS BETWEEN [ { m | UNBOUNDED } PRECEDING | CURRENT ROW] [ AND [CURRENT ROW | { UNBOUNDED | n } FOLLOWING] ]
RANGE BETWEEN [ {m | UNBOUNDED } PRECEDING | CURRENT ROW] [ AND [CURRENT ROW | { UNBOUNDED | n } FOLLOWING] ]

目前的impala over语句之前允许的聚合函数:

 

AVG()
COUNT()
MAX()
MIN()
SUM() 
 

下面的聚合函数暂不支持:
STDDEV_POP(), STDDEV(), STD(),STDDEV_SAMP()
VAR_POP(), VARIANCE(),VAR_SAMP()

CUME_DIST()
DENSE_RANK()
FIRST_VALUE()
LAG()
LAST_VALUE()
LEAD()
NTH_VALUE()
NTILE()
PERCENT_RANK()
RANK()
ROW_NUMBER()

impala参考资料:

http://impala.apache.org/docs/build3x/html/topics/impala_aggregate_functions.html

http://impala.apache.org/docs/build3x/html/topics/impala_analytic_functions.html

https://docs.cloudera.com/documentation/enterprise/latest/topics/impala_aggregate_functions.html

https://docs.cloudera.com/documentation/enterprise/latest/topics/impala_analytic_functions.html

 

oracle相关资料:

https://docs.oracle.com/cd/E11882_01/server.112/e41084/functions003.htm#SQLRF20035

https://docs.oracle.com/cd/E11882_01/server.112/e41084/functions004.htm#SQLRF06174

 

MySQL 相关资料:

https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html

https://dev.mysql.com/doc/refman/8.0/en/window-function-descriptions.html

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 技术工厂 设计师:CSDN官方博客 返回首页