You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/07/17 06:09:58 UTC

[kylin] branch master updated: KYLIN-3255 Cannot save cube

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a9a333  KYLIN-3255 Cannot save cube
8a9a333 is described below

commit 8a9a333a053634d4885087979826fbe016f13bbd
Author: GinaZhai <na...@kyligence.io>
AuthorDate: Tue Jul 10 22:15:15 2018 +0800

    KYLIN-3255 Cannot save cube
    
    Signed-off-by: shaofengshi <sh...@apache.org>
---
 .../src/main/java/org/apache/kylin/cube/CubeDescManager.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java
index 78c71b7..db42263 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeDescManager.java
@@ -276,8 +276,13 @@ public class CubeDescManager {
                     String encoding = configuration.get(TopNMeasureType.CONFIG_ENCODING_PREFIX + parameter.getValue());
                     String encodingVersionStr = configuration
                             .get(TopNMeasureType.CONFIG_ENCODING_VERSION_PREFIX + parameter.getValue());
-                    if (StringUtils.isEmpty(encoding) || DictionaryDimEnc.ENCODING_NAME.equals(encoding)) {
-                        keyLength += DictionaryDimEnc.MAX_ENCODING_LENGTH; // estimation for dict encoding
+                    if (StringUtils.isEmpty(encoding) || encoding.startsWith("dict")) {
+                        if (DictionaryDimEnc.ENCODING_NAME.equals(encoding)) {
+                            keyLength += DictionaryDimEnc.MAX_ENCODING_LENGTH; // estimation for dict encoding
+                        } else {
+                            throw new IllegalArgumentException(
+                                    "TOP_N's Encoding is " + encoding + ", please choose the correct one");
+                        }
                     } else {
                         // non-dict encoding
                         int encodingVersion = 1;