You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/11/07 03:54:00 UTC

[GitHub] QiuMM opened a new issue #6583: support rollup mode [COUNT() -> SUM(count)]

QiuMM opened a new issue #6583: support rollup mode [COUNT() -> SUM(count)]
URL: https://github.com/apache/incubator-druid/issues/6583
 
 
   ### Motivation
   
   In my company, we use Druid as our OLAP engine that enables business users to analyze large quantities of data in real-time. However, druid will rollup data(if enable) at ingestion time. So when our users use `count()` in their sql, they often get unexpected results. Our users are not familiar with druid, it's hard for them to write a sql that will work as expected. So it would be better that druid support rollup mode, i.e. rewrite COUNT() to SUM(count), make it transparent to users.
   
   ### Proposed solution
   
   Add a boolean property `rollup` in `PlannerConfig` to indicate whether using the rollup mode or not. If it's true, in `CountSqlAggregator#toDruidAggregation` create a `LongSumAggregatorFactory` instead of a `CountAggregatorFactory`. 
   
   In `DruidSchema#analysisToRowSignature`, we can get aggregators info and find the defined count metric name, then using this name to construct a `LongSumAggregatorFactory`. However, currently I could not infer which one is the count aggregator from segment metadata query result, the related issue is #6578. 
   
   In order to support rollup mode, #6578 must be fixed first. Looking forward to your comments.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org