kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahong...@apache.org
Subject kylin git commit: KYLIN-2134 dont reuse Object[] returned to calcite
Date Fri, 28 Oct 2016 01:52:03 GMT
Repository: kylin
Updated Branches:
  refs/heads/v1.6.0-rc1 1af3d9ee3 -> 8199a90c5


KYLIN-2134 dont reuse Object[] returned to calcite


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

Branch: refs/heads/v1.6.0-rc1
Commit: 8199a90c57df12e8ad4a19737ffa9aa17a69f3eb
Parents: 1af3d9e
Author: Li Yang <liyang@apache.org>
Authored: Thu Oct 27 17:09:22 2016 +0800
Committer: Hongbin Ma <mahongbin@apache.org>
Committed: Fri Oct 28 09:51:51 2016 +0800

----------------------------------------------------------------------
 .../kylin/storage/gtrecord/SegmentCubeTupleIterator.java     | 4 ----
 .../org/apache/kylin/query/enumerator/OLAPEnumerator.java    | 8 ++++----
 2 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/8199a90c/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SegmentCubeTupleIterator.java
----------------------------------------------------------------------
diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SegmentCubeTupleIterator.java
b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SegmentCubeTupleIterator.java
index 61267ae..00ba247 100644
--- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SegmentCubeTupleIterator.java
+++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/SegmentCubeTupleIterator.java
@@ -37,8 +37,6 @@ import org.apache.kylin.storage.StorageContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 public class SegmentCubeTupleIterator implements ITupleIterator {
 
     private static final Logger logger = LoggerFactory.getLogger(SegmentCubeTupleIterator.class);
@@ -98,8 +96,6 @@ public class SegmentCubeTupleIterator implements ITupleIterator {
         }
         GTRecord curRecord = gtItr.next();
 
-        Preconditions.checkNotNull(cubeTupleConverter);
-
         // translate into tuple
         advMeasureFillers = cubeTupleConverter.translateResult(curRecord, tuple);
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/8199a90c/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java b/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
index dafbb5f..c7b3c71 100644
--- a/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
+++ b/query/src/main/java/org/apache/kylin/query/enumerator/OLAPEnumerator.java
@@ -18,6 +18,7 @@
 
 package org.apache.kylin.query.enumerator;
 
+import java.util.Arrays;
 import java.util.Map;
 import java.util.Properties;
 
@@ -77,10 +78,9 @@ public class OLAPEnumerator implements Enumerator<Object[]> {
     }
 
     private Object[] convertCurrentRow(ITuple tuple) {
-        // make sure the tuple layout is correct
-        //assert tuple.getAllFields().equals(olapContext.returnTupleInfo.getAllFields());
-
-        current = tuple.getAllValues();
+        // give calcite a new array every time, see details in KYLIN-2134
+        Object[] values = tuple.getAllValues();
+        current = Arrays.copyOf(values, values.length);
         return current;
     }
 


Mime
View raw message