zhengshengjun commented on a change in pull request #1619:
URL: https://github.com/apache/kylin/pull/1619#discussion_r602889485
##########
File path:
kylin-spark-project/kylin-spark-query/src/main/scala/org/apache/kylin/query/runtime/plans/AggregatePlan.scala
##########
@@ -53,10 +53,32 @@ object AggregatePlan extends LogEx {
.map(groupId => col(schemaNames.apply(groupId)))
.toList
- if (rel.getContext != null && rel.getContext.isExactlyAggregate) {
+ rel.getContext.isExactlyAggregate = isExactlyCuboidMatched(rel, groupList)
+ if (rel.getContext.isExactlyAggregate) {
// exactly match, skip agg, direct project.
- val aggCols = rel.getRewriteAggCalls.asScala
- .map(call => col(schemaNames.apply(call.getArgList.get(0)))).toList
+ val hash = System.identityHashCode(rel).toString
+ val aggCols = rel.getRewriteAggCalls.asScala.zipWithIndex.map {
+ case (call: KylinAggregateCall, index: Int)
+ if OLAPAggregateRel.getAggrFuncName(call).equals("COUNT_DISTINCT") =>
+ val dataType = call.getFunc.getReturnDataType
+ val funcName = OLAPAggregateRel.getAggrFuncName(call)
+ val argNames =
call.getArgList.asScala.map(dataFrame.schema.names.apply(_))
+ val columnName = argNames.map(col)
+ val aggName = SchemaProcessor.replaceToAggravateSchemaName(index,
funcName, hash, argNames: _*)
+ if (dataType.getName == "hllc") {
Review comment:
What about adding a 'isHLLCountDistinct' method in FunctionDesc,
sometimes I have trouble judging whether this count_distinct function is HLL or
precise count distinct ==
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]