You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/06/01 05:11:21 UTC

kylin git commit: KYLIN-2593 fix hard coding in TopNMeasureType

Repository: kylin
Updated Branches:
  refs/heads/2.0.x 38389d106 -> a9a1c2f53


KYLIN-2593 fix hard coding in TopNMeasureType


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a9a1c2f5
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a9a1c2f5
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a9a1c2f5

Branch: refs/heads/2.0.x
Commit: a9a1c2f53770e73ae1cfe8b882f2b946fd577ffe
Parents: 38389d1
Author: Hongbin Ma <ma...@apache.org>
Authored: Thu Jun 1 13:11:08 2017 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Thu Jun 1 13:11:08 2017 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/kylin/measure/topn/TopNMeasureType.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/a9a1c2f5/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
index f936cb8..89ed8ae 100644
--- a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
+++ b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
@@ -40,6 +40,7 @@ import org.apache.kylin.metadata.datatype.DataType;
 import org.apache.kylin.metadata.datatype.DataTypeSerializer;
 import org.apache.kylin.metadata.model.FunctionDesc;
 import org.apache.kylin.metadata.model.MeasureDesc;
+import org.apache.kylin.metadata.model.ParameterDesc;
 import org.apache.kylin.metadata.model.TblColRef;
 import org.apache.kylin.metadata.realization.CapabilityResult.CapabilityInfluence;
 import org.apache.kylin.metadata.realization.SQLDigest;
@@ -371,7 +372,8 @@ public class TopNMeasureType extends MeasureType<TopNCounter<ByteArray>> {
         if (numericCol != null) {
             numericTupleIdx = tupleInfo.hasColumn(numericCol) ? tupleInfo.getColumnIndex(numericCol) : -1;
         } else {
-            numericTupleIdx = tupleInfo.getFieldIndex("COUNT__");
+            FunctionDesc countFunction = FunctionDesc.newInstance(FunctionDesc.FUNC_COUNT, ParameterDesc.newInstance("1"), "bigint");
+            numericTupleIdx = tupleInfo.getFieldIndex(countFunction.getRewriteFieldName());
         }
         return new IAdvMeasureFiller() {
             private TopNCounter<ByteArray> topNCounter;