[ 
https://issues.apache.org/jira/browse/KYLIN-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15499096#comment-15499096
 ] 

hongbin ma commented on KYLIN-1573:
-----------------------------------

maybe we can borrow the idea of UDAF frameworks from hive to allow customized 
aggregate functions. With UDAF users can define his own aggregator (with a 
separate jar) that will be used both in cube building and cube querying. The 
drawback is he has to create and use a new aggregator name, which will be a 
problem if the queries are automatically generated by BI tools. Hive UDAF is 
already the de facto standard and spark borrows it too.

Creating a new column with Hive View is the suggested option for now.



> aggregator expression like sum(a+b) is not working
> --------------------------------------------------
>
>                 Key: KYLIN-1573
>                 URL: https://issues.apache.org/jira/browse/KYLIN-1573
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: 1.x-HBase1.1.3
>            Reporter: Babulal
>            Assignee: liyang
>            Priority: Minor
>              Labels: newbie, test
>
> In Kylin expression like + ,/.* ..ect are not working .  
> for example 
> select country,
>        city,
>             sum(male_population+Female_population)
>            
>   from population 
>  group by country,city.
> Error 
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.kylin.cube.CubeCapabilityChecker.tryDimensionAsMeasures(CubeCapabilityChecker.java:170)
>       at 
> org.apache.kylin.cube.CubeCapabilityChecker.check(CubeCapabilityChecker.java:73)
>       at org.apache.kylin.cube.CubeInstance.isCapable(CubeInstance.java:330)
>       at 
> org.apache.kylin.query.routing.rules.RemoveUncapableRealizationsRule.apply(RemoveUncapableRealizationsRule.java:36)
>       at 
> org.apache.kylin.query.routing.RoutingRule.applyRules(RoutingRule.java:47)
>       at 
> org.apache.kylin.query.routing.QueryRouter.selectRealization(QueryRouter.java:63)
>       at 
> org.apache.kylin.query.relnode.OLAPToEnumerableConverter.implement(OLAPToEnumerableConverter.java:80)
>       at 
> org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:102)
>       at 
> org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:92)
>       at 
> org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1171)
>       at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:297)
>       at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:196)
> When Query changed as below it is working fine . 
> select country,
>        city,
>             sum(male_population)+sum(Female_population)
>            
>   from population 
>  group by country,city.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to