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

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


The following commit(s) were added to refs/heads/2.4.x by this push:
     new 6e5cfd6  KYLIN-3255 Cannot save cube
6e5cfd6 is described below

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

    KYLIN-3255 Cannot save cube
    
    Signed-off-by: shaofengshi <shaofeng...@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;

Reply via email to