phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea_julianos <Andrea_julia...@outlook.com>
Subject How to custom Aggregate Function into phoenix-core
Date Tue, 23 Jul 2019 03:45:58 GMT
Hello, I want to custom a aggregate function like sum function, I call it
ZSum, 

so, I add some class such as 
org.apache.phoenix.expression.aggregator.ZCountAggregator
org.apache.phoenix.expression.aggregator.ZDecimalSumAggregator
org.apache.phoenix.expression.aggregator.ZDoubleSumAggregator
org.apache.phoenix.expression.aggregator.ZIntSumAggregator
org.apache.phoenix.expression.aggregator.ZLongSumAggregator
org.apache.phoenix.expression.aggregator.ZNumberSumAggregator
org.apache.phoenix.expression.aggregator.ZUnsignedIntSumAggregator
org.apache.phoenix.expression.aggregator.ZUnsignedLongSumAggregator
org.apache.phoenix.expression.function.ZCountAggregateFunction
org.apache.phoenix.expression.function.ZDelegateConstantToCountAggregateFunction
org.apache.phoenix.expression.function.ZSumAggregateFunction
org.apache.phoenix.expression.parse.ZDelegateConstantToCountParseNode
org.apache.phoenix.expression.parse.ZSumAggregateParseNode

Also, I registers two class(ZCountAggregateFunction,ZSumAggregateFunction)
into ExpressionType

but, when I run 
select sum(DECI) from T1.TABLE, the result is 55(1+2+...+10), 
when I run 
select ZSum(DECI) from T1.TABLE, the result is 2.

where was wrong, and what I forget add class
Thanks, With lofty greetings  !



--
Sent from: http://apache-phoenix-user-list.1124778.n5.nabble.com/

Mime
View raw message