kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luke...@apache.org
Subject [01/50] [abbrv] incubator-kylin git commit: KYLIN-934 automatically upgrade metrics that may overflow
Date Sun, 06 Sep 2015 07:39:07 GMT
Repository: incubator-kylin
Updated Branches:
  refs/heads/master f96d6e99c -> 575eee0d0


KYLIN-934 automatically upgrade metrics that may overflow


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

Branch: refs/heads/master
Commit: 1ef0eb6b0ebbaff9b143ec302d2264e1cbc81fcb
Parents: 23169e2
Author: honma <honma@ebay.com>
Authored: Tue Aug 11 00:33:03 2015 +0800
Committer: honma <honma@ebay.com>
Committed: Tue Aug 11 00:33:03 2015 +0800

----------------------------------------------------------------------
 .../common/util/HBaseMetadataTestCase.java      |  6 ++++
 .../kylin/invertedindex/model/IIDesc.java       |  2 +-
 .../kylin/metadata/project/ProjectL2Cache.java  |  9 ++++--
 .../kylin/metadata/project/ProjectManager.java  |  4 +--
 .../kylin/query/relnode/OLAPAggregateRel.java   |  4 ++-
 .../apache/kylin/query/schema/OLAPTable.java    | 29 +++++++++++++++++---
 .../apache/kylin/query/test/IIQueryTest.java    |  5 ++--
 query/src/test/resources/query/sql/query00.sql  |  2 +-
 query/src/test/resources/query/sql/query10.sql  |  2 +-
 query/src/test/resources/query/sql/query20.sql  |  2 +-
 query/src/test/resources/query/sql/query30.sql  |  2 +-
 query/src/test/resources/query/sql/query40.sql  |  2 +-
 query/src/test/resources/query/sql/query50.sql  |  2 +-
 query/src/test/resources/query/sql/query60.sql  |  2 +-
 query/src/test/resources/query/sql/query70.sql  |  2 +-
 query/src/test/resources/query/sql/query80.sql  |  2 +-
 .../src/test/resources/query/sql_ii/query04.sql |  2 +-
 .../src/test/resources/query/sql_ii/query08.sql |  2 +-
 .../endpoint/EndpointTupleIterator.java         |  3 +-
 19 files changed, 58 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/common/src/test/java/org/apache/kylin/common/util/HBaseMetadataTestCase.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/kylin/common/util/HBaseMetadataTestCase.java
b/common/src/test/java/org/apache/kylin/common/util/HBaseMetadataTestCase.java
index 6cbd9b0..923f6ab 100644
--- a/common/src/test/java/org/apache/kylin/common/util/HBaseMetadataTestCase.java
+++ b/common/src/test/java/org/apache/kylin/common/util/HBaseMetadataTestCase.java
@@ -18,6 +18,8 @@
 
 package org.apache.kylin.common.util;
 
+import org.apache.commons.lang.StringUtils;
+
 import java.io.File;
 
 /**
@@ -57,6 +59,10 @@ public class HBaseMetadataTestCase extends AbstractKylinTestCase {
 
     public static boolean useSandbox() {
         String useSandbox = System.getProperty("useSandbox");
+        if (StringUtils.isEmpty(useSandbox)) {
+            return true;
+        }
+
         return Boolean.parseBoolean(useSandbox);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIDesc.java
----------------------------------------------------------------------
diff --git a/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIDesc.java
b/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIDesc.java
index ac935b8..2c1f401 100644
--- a/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIDesc.java
+++ b/invertedindex/src/main/java/org/apache/kylin/invertedindex/model/IIDesc.java
@@ -122,7 +122,7 @@ public class IIDesc extends RootPersistentEntity {
                 TblColRef tcr = new TblColRef(columnDesc);
                 allColumns.add(tcr);
                 allDimensions.add(tcr);
-                measureDescs.add(makeHLLMeasure(columnDesc, null));
+                measureDescs.add(makeHLLMeasure(columnDesc, "hllc10"));
             }
 
             if (!allTableNames.contains(tableDesc.getIdentity())) {

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
b/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
index 994bd3e..2995ceb 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
@@ -125,15 +125,20 @@ class ProjectL2Cache {
         return result;
     }
 
-    public List<MeasureDesc> listEffectiveRewriteMeasures(String project, String factTable)
{
+    public List<MeasureDesc> listEffectiveMeasures(String project, String factTable,
boolean onlyRewriteMeasure) {
         Set<IRealization> realizations = getRealizationsByTable(project, factTable);
         List<MeasureDesc> result = Lists.newArrayList();
         for (IRealization r : realizations) {
             if (r.getFactTable().equalsIgnoreCase(factTable) && r.isReady()) {
                 for (MeasureDesc m : r.getMeasures()) {
                     FunctionDesc func = m.getFunction();
-                    if (func.needRewrite())
+
+                    if (onlyRewriteMeasure) {
+                        if (func.needRewrite())
+                            result.add(m);
+                    } else {
                         result.add(m);
+                    }
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java
b/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java
index a0b3162..6e3c14e 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java
@@ -316,8 +316,8 @@ public class ProjectManager {
         return l2Cache.getOnlineRealizationByFactTable(norm(project), factTable.toUpperCase());
     }
 
-    public List<MeasureDesc> listEffectiveRewriteMeasures(String project, String factTable)
{
-        return l2Cache.listEffectiveRewriteMeasures(norm(project), factTable.toUpperCase());
+    public List<MeasureDesc> listEffectiveMeasures(String project, String factTable,
boolean onlyRewriteMeasure) {
+        return l2Cache.listEffectiveMeasures(norm(project), factTable.toUpperCase(), onlyRewriteMeasure);
     }
 
     KylinConfig getConfig() {

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
index b9adb4a..e950911 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
@@ -177,13 +177,15 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel {
     }
 
     private TblColRef buildRewriteColumn(FunctionDesc aggFunc) {
-        TblColRef colRef = null;
+        TblColRef colRef;
         if (aggFunc.needRewrite()) {
             ColumnDesc column = new ColumnDesc();
             column.setName(aggFunc.getRewriteFieldName());
             TableDesc table = this.context.firstTableScan.getOlapTable().getSourceTable();
             column.setTable(table);
             colRef = new TblColRef(column);
+        } else {
+            throw new IllegalStateException("buildRewriteColumn on a aggrFunc that does not
need rewrite " + aggFunc);
         }
         return colRef;
     }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/main/java/org/apache/kylin/query/schema/OLAPTable.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/schema/OLAPTable.java b/query/src/main/java/org/apache/kylin/query/schema/OLAPTable.java
index f4eaa08..54587f8 100644
--- a/query/src/main/java/org/apache/kylin/query/schema/OLAPTable.java
+++ b/query/src/main/java/org/apache/kylin/query/schema/OLAPTable.java
@@ -52,7 +52,9 @@ import org.apache.kylin.query.enumerator.OLAPQuery;
 import org.apache.kylin.query.enumerator.OLAPQuery.EnumeratorTypeEnum;
 import org.apache.kylin.query.relnode.OLAPTableScan;
 
+import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 
 /**
  */
@@ -161,10 +163,11 @@ public class OLAPTable extends AbstractQueryableTable implements TranslatableTab
 
     private List<ColumnDesc> listSourceColumns() {
         ProjectManager mgr = ProjectManager.getInstance(olapSchema.getConfig());
-        List<ColumnDesc> exposedColumns = Lists.newArrayList(mgr.listExposedColumns(olapSchema.getProjectName(),
sourceTable.getIdentity()));
+        List<ColumnDesc> tableColumns = Lists.newArrayList(mgr.listExposedColumns(olapSchema.getProjectName(),
sourceTable.getIdentity()));
 
-        List<MeasureDesc> countMeasures = mgr.listEffectiveRewriteMeasures(olapSchema.getProjectName(),
sourceTable.getIdentity());
+        List<MeasureDesc> countMeasures = mgr.listEffectiveMeasures(olapSchema.getProjectName(),
sourceTable.getIdentity(), true);
         HashSet<String> metFields = new HashSet<String>();
+        List<ColumnDesc> metricColumns = Lists.newArrayList();
         for (MeasureDesc m : countMeasures) {
             FunctionDesc func = m.getFunction();
             String fieldName = func.getRewriteFieldName();
@@ -176,11 +179,29 @@ public class OLAPTable extends AbstractQueryableTable implements TranslatableTab
                 if (func.isCount())
                     fakeCountCol.setNullable(false);
                 fakeCountCol.init(sourceTable);
-                exposedColumns.add(fakeCountCol);
+                metricColumns.add(fakeCountCol);
             }
         }
 
-        return exposedColumns;
+        //if exist sum(x), where x is integer/short/byte
+        //to avoid overflow we upgrade x's type to long
+        HashSet<ColumnDesc> updateColumns = Sets.newHashSet();
+        for (MeasureDesc m : mgr.listEffectiveMeasures(olapSchema.getProjectName(), sourceTable.getIdentity(),
false)) {
+            if (m.getFunction().isSum()) {
+                FunctionDesc functionDesc = m.getFunction();
+                if (functionDesc.getReturnDataType() != functionDesc.getSQLType() &&
//
+                        functionDesc.getReturnDataType().isBigInt() && //
+                        functionDesc.getSQLType().isIntegerFamily()) {
+                    updateColumns.add(functionDesc.getParameter().getColRefs().get(0).getColumnDesc());
+                }
+            }
+        }
+        for (ColumnDesc upgrade : updateColumns) {
+            int index = tableColumns.indexOf(upgrade);
+            tableColumns.get(index).setDatatype("bigint");
+        }
+
+        return Lists.newArrayList(Iterables.concat(tableColumns, metricColumns));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/java/org/apache/kylin/query/test/IIQueryTest.java
----------------------------------------------------------------------
diff --git a/query/src/test/java/org/apache/kylin/query/test/IIQueryTest.java b/query/src/test/java/org/apache/kylin/query/test/IIQueryTest.java
index fa40dd4..73b570c 100644
--- a/query/src/test/java/org/apache/kylin/query/test/IIQueryTest.java
+++ b/query/src/test/java/org/apache/kylin/query/test/IIQueryTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.kylin.query.test;
 
+import java.io.File;
 import java.util.Map;
 
 import org.apache.kylin.metadata.realization.RealizationType;
@@ -28,9 +29,6 @@ import org.junit.Test;
 
 import com.google.common.collect.Maps;
 
-/**
- * Created by Hongbin Ma(Binmahone) on 2/2/15.
- */
 public class IIQueryTest extends KylinQueryTest {
     @BeforeClass
     public static void setUp() throws Exception {
@@ -61,4 +59,5 @@ public class IIQueryTest extends KylinQueryTest {
         execAndCompQuery("src/test/resources/query/sql_ii", null, true);
     }
 
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query00.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query00.sql b/query/src/test/resources/query/sql/query00.sql
index 6e4d94b..3a02cb6 100644
--- a/query/src/test/resources/query/sql/query00.sql
+++ b/query/src/test/resources/query/sql/query00.sql
@@ -16,7 +16,7 @@
 -- limitations under the License.
 --
 
-select lstg_format_name, sum(price) as GMV 
+select lstg_format_name, sum(price) as GMV , sum(test_kylin_fact.item_count) as total_items
  from test_kylin_fact 
  where lstg_format_name='FP-GTC' 
  group by lstg_format_name 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query10.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query10.sql b/query/src/test/resources/query/sql/query10.sql
index 9bef4bf..408fd31 100644
--- a/query/src/test/resources/query/sql/query10.sql
+++ b/query/src/test/resources/query/sql/query10.sql
@@ -17,7 +17,7 @@
 --
 
 select test_cal_dt.week_beg_dt,sum(test_kylin_fact.price) as GMV 
- , count(*) as TRANS_CNT 
+ , count(*) as TRANS_CNT , sum(test_kylin_fact.item_count) as total_items
  from test_kylin_fact 
  inner JOIN edw.test_cal_dt as test_cal_dt  
  ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query20.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query20.sql b/query/src/test/resources/query/sql/query20.sql
index e87565a..ead4935 100644
--- a/query/src/test/resources/query/sql/query20.sql
+++ b/query/src/test/resources/query/sql/query20.sql
@@ -19,7 +19,7 @@
 SELECT 
  test_cal_dt.week_beg_dt 
  ,test_category_groupings.meta_categ_name 
- ,sum(price) as GMV, count(*) as TRANS_CNT 
+ ,sum(price) as GMV, count(*) as TRANS_CNT , sum(test_kylin_fact.item_count) as total_items
  FROM test_kylin_fact 
  inner JOIN edw.test_cal_dt as test_cal_dt  
  ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query30.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query30.sql b/query/src/test/resources/query/sql/query30.sql
index 35e37a1..d27476c 100644
--- a/query/src/test/resources/query/sql/query30.sql
+++ b/query/src/test/resources/query/sql/query30.sql
@@ -16,4 +16,4 @@
 -- limitations under the License.
 --
 
-select sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact limit 50 
+select sum(price) as GMV, count(1) as TRANS_CNT, sum(test_kylin_fact.item_count) as total_items
from test_kylin_fact limit 50 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query40.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query40.sql b/query/src/test/resources/query/sql/query40.sql
index 74484cc..2c583ad 100644
--- a/query/src/test/resources/query/sql/query40.sql
+++ b/query/src/test/resources/query/sql/query40.sql
@@ -16,7 +16,7 @@
 -- limitations under the License.
 --
 
-select cal_dt, lstg_format_name, sum(price) as GMV 
+select cal_dt, lstg_format_name, sum(price) as GMV, sum(test_kylin_fact.item_count) as total_items

  from test_kylin_fact 
  where cal_dt between date '2013-05-06' and date '2013-07-31' 
  group by cal_dt, lstg_format_name 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query50.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query50.sql b/query/src/test/resources/query/sql/query50.sql
index 89e7b80..0c331ce 100644
--- a/query/src/test/resources/query/sql/query50.sql
+++ b/query/src/test/resources/query/sql/query50.sql
@@ -17,7 +17,7 @@
 --
 
 select test_kylin_fact.lstg_format_name, test_cal_dt.week_beg_dt,sum(test_kylin_fact.price)
as GMV 
- , count(*) as TRANS_CNT 
+ , count(*) as TRANS_CNT, sum(test_kylin_fact.item_count) as total_items 
  from test_kylin_fact 
  inner JOIN edw.test_cal_dt as test_cal_dt 
  ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query60.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query60.sql b/query/src/test/resources/query/sql/query60.sql
index 8507e63..6a73b32 100644
--- a/query/src/test/resources/query/sql/query60.sql
+++ b/query/src/test/resources/query/sql/query60.sql
@@ -16,7 +16,7 @@
 -- limitations under the License.
 --
 
-select test_kylin_fact.cal_dt, sum(test_kylin_fact.price) as sum_price, count(1) as cnt_1
+select test_kylin_fact.cal_dt, sum(test_kylin_fact.price) as sum_price, count(1) as cnt_1,
sum(test_kylin_fact.item_count) as total_items
 from test_kylin_fact 
 left JOIN edw.test_cal_dt as test_cal_dt on test_kylin_fact.cal_dt=test_cal_dt.cal_dt 
 group by test_kylin_fact.cal_dt 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query70.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query70.sql b/query/src/test/resources/query/sql/query70.sql
index 26b6eb2..c032f5d 100644
--- a/query/src/test/resources/query/sql/query70.sql
+++ b/query/src/test/resources/query/sql/query70.sql
@@ -18,7 +18,7 @@
 
 select lstg_format_name, 
  sum(price) as GMV, 
- count(1) as TRANS_CNT 
+ count(1) as TRANS_CNT, sum(test_kylin_fact.item_count) as total_items 
  from test_kylin_fact 
  where "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" = 'Auction' and (CASE WHEN ("TEST_KYLIN_FACT"."LSTG_FORMAT_NAME"
IN ('Auction', 'FP-GTC')) THEN 'Auction' ELSE "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" END) =
'Auction'
  group by lstg_format_name 

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql/query80.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query80.sql b/query/src/test/resources/query/sql/query80.sql
index 990e6dc..0bbbb9e 100644
--- a/query/src/test/resources/query/sql/query80.sql
+++ b/query/src/test/resources/query/sql/query80.sql
@@ -18,7 +18,7 @@
 
 SELECT
  min(test_cal_dt.cal_dt) as mmin
- ,max(test_cal_dt.cal_dt) as mmax
+ ,max(test_cal_dt.cal_dt) as mmax, sum(test_kylin_fact.item_count) as total_items
  FROM test_kylin_fact
  inner JOIN edw.test_cal_dt as test_cal_dt
  ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql_ii/query04.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql_ii/query04.sql b/query/src/test/resources/query/sql_ii/query04.sql
index 5b1e29d..4a75fba 100644
--- a/query/src/test/resources/query/sql_ii/query04.sql
+++ b/query/src/test/resources/query/sql_ii/query04.sql
@@ -16,4 +16,4 @@
 -- limitations under the License.
 --
 
-select TRANS_ID,CAL_DT,LSTG_FORMAT_NAME,LEAF_CATEG_ID,LSTG_SITE_ID,SLR_SEGMENT_CD,PRICE,ITEM_COUNT,SELLER_ID
from test_kylin_fact where LSTG_FORMAT_NAME = 'ABIN'
+select TRANS_ID,CAL_DT,LSTG_FORMAT_NAME,LEAF_CATEG_ID,LSTG_SITE_ID,SLR_SEGMENT_CD,PRICE,SELLER_ID
from test_kylin_fact where LSTG_FORMAT_NAME = 'ABIN'

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/query/src/test/resources/query/sql_ii/query08.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql_ii/query08.sql b/query/src/test/resources/query/sql_ii/query08.sql
index 242cb22..51a676d 100644
--- a/query/src/test/resources/query/sql_ii/query08.sql
+++ b/query/src/test/resources/query/sql_ii/query08.sql
@@ -16,4 +16,4 @@
 -- limitations under the License.
 --
 
-select TRANS_ID,CAL_DT,LSTG_FORMAT_NAME,LEAF_CATEG_ID,LSTG_SITE_ID,SLR_SEGMENT_CD,PRICE,ITEM_COUNT,SELLER_ID
from test_kylin_fact where LSTG_FORMAT_NAME > 'ABIN'
+select TRANS_ID,CAL_DT,LSTG_FORMAT_NAME,LEAF_CATEG_ID,LSTG_SITE_ID,SLR_SEGMENT_CD,PRICE,SELLER_ID
from test_kylin_fact where LSTG_FORMAT_NAME > 'ABIN'

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/1ef0eb6b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/EndpointTupleIterator.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/EndpointTupleIterator.java
b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/EndpointTupleIterator.java
index 6ab2429..14febe3 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/EndpointTupleIterator.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hbase/coprocessor/endpoint/EndpointTupleIterator.java
@@ -340,8 +340,7 @@ public class EndpointTupleIterator implements ITupleIterator {
                         String fieldName = measures.get(i).getRewriteFieldName();
                         Object value = measureValues.get(i);
                         String dataType = tuple.getDataType(fieldName);
-                        //TODO: currently in II all metrics except HLLC is returned as String
-                        if (dataType.toLowerCase().equalsIgnoreCase("hllc")) {
+                        if (value instanceof String) {
                             value = Tuple.convertOptiqCellValue((String) value, dataType);
                         }
                         tuple.setMeasureValue(fieldName, value);


Mime
View raw message