You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2015/09/07 13:20:53 UTC

[18/28] incubator-kylin git commit: KYLIN-1004 Dictionary with '' value cause cube merge to fail

KYLIN-1004 Dictionary with '' value cause cube merge to fail


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

Branch: refs/heads/2.x-staging
Commit: 3116d5563620ed30918a99295ab96ca27edca259
Parents: cdc33f5
Author: Li, Yang <ya...@ebay.com>
Authored: Sun Sep 6 15:33:40 2015 +0800
Committer: Li, Yang <ya...@ebay.com>
Committed: Sun Sep 6 15:34:16 2015 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/dict/TrieDictionary.java | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/3116d556/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionary.java
----------------------------------------------------------------------
diff --git a/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionary.java b/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionary.java
index 995ea7a..39a8e7e 100644
--- a/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionary.java
+++ b/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionary.java
@@ -148,9 +148,7 @@ public class TrieDictionary<T> extends Dictionary<T> {
     @Override
     final protected int getIdFromValueImpl(T value, int roundingFlag) {
         if (enableValueCache && roundingFlag == 0) {
-            HashMap cache = valueToIdCache.get(); // SoftReference to skip cache
-                                                  // gracefully when short of
-                                                  // memory
+            HashMap cache = valueToIdCache.get(); // SoftReference to skip cache gracefully when short of memory
             if (cache != null) {
                 Integer id = null;
                 id = (Integer) cache.get(value);
@@ -194,7 +192,7 @@ public class TrieDictionary<T> extends Dictionary<T> {
      *            -- >0: return closest bigger if not found, return nValues
      */
     private int lookupSeqNoFromValue(int n, byte[] inp, int o, int inpEnd, int roundingFlag) {
-        if (inp.length == 0) // special 'empty' value
+        if (o == inpEnd) // special 'empty' value
             return checkFlag(headSize, BIT_IS_END_OF_VALUE) ? 0 : roundSeqNo(roundingFlag, -1, -1, 0);
 
         int seq = 0; // the sequence no under track
@@ -231,8 +229,7 @@ public class TrieDictionary<T> extends Dictionary<T> {
             while (true) {
                 p = c + firstByteOffset;
                 comp = BytesUtil.compareByteUnsigned(trieBytes[p], inpByte);
-                if (comp == 0) { // continue in the matching child, reset n and
-                                 // loop again
+                if (comp == 0) { // continue in the matching child, reset n and loop again
                     n = c;
                     o++;
                     break;