You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2022/12/05 10:21:01 UTC

[kylin] 09/22: KYLIN-5316 fix stackOverflowError when cc colmun name equals dimension name

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

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

commit 6836fba58026aaa913808259facc13863e83f17d
Author: Shuai li <lo...@live.cn>
AuthorDate: Fri Oct 14 12:27:20 2022 +0800

    KYLIN-5316 fix stackOverflowError when cc colmun name equals dimension name
---
 .../apache/kylin/metadata/model/util/ComputedColumnUtil.java | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/core-metadata/src/main/java/org/apache/kylin/metadata/model/util/ComputedColumnUtil.java b/src/core-metadata/src/main/java/org/apache/kylin/metadata/model/util/ComputedColumnUtil.java
index 451b8280d4..b07c7cf5b0 100644
--- a/src/core-metadata/src/main/java/org/apache/kylin/metadata/model/util/ComputedColumnUtil.java
+++ b/src/core-metadata/src/main/java/org/apache/kylin/metadata/model/util/ComputedColumnUtil.java
@@ -702,7 +702,7 @@ public class ComputedColumnUtil {
                 if (checkedCC.contains(cc)) {
                     continue;
                 }
-                ccUsedColsMap.put(cc.getColumnName(), ComputedColumnUtil.getCCUsedColsWithModel(model, cc));
+                ccUsedColsMap.put(cc.getIdentName(), ComputedColumnUtil.getCCUsedColsWithModel(model, cc));
             }
 
             // parse inner expression might cause error, for example timestampdiff
@@ -712,7 +712,7 @@ public class ComputedColumnUtil {
                     continue;
                 }
                 val ccUsedSourceCols = Sets.<String> newHashSet();
-                collectCCUsedSourceCols(cc.getColumnName(), ccUsedColsMap, ccUsedSourceCols);
+                collectCCUsedSourceCols(cc.getIdentName(), ccUsedColsMap, ccUsedSourceCols);
                 ccUsedSourceCols.removeIf(checkedCCUsedSourceCols::contains);
                 if (ccUsedSourceCols.isEmpty() || isColumnAuthorizedFunc.test(ccUsedSourceCols)) {
                     authorizedCC.add(cc);
@@ -726,15 +726,11 @@ public class ComputedColumnUtil {
 
     public static void collectCCUsedSourceCols(String ccColName, Map<String, Set<String>> ccUsedColsMap,
             Set<String> ccUsedSourceCols) {
-        String ccColNameWithoutDot = ccColName.contains(".") ? ccColName.substring(ccColName.lastIndexOf(".") + 1)
-                : ccColName;
-
-        if (!ccUsedColsMap.containsKey(ccColNameWithoutDot)) {
+        if (!ccUsedColsMap.containsKey(ccColName)) {
             ccUsedSourceCols.add(ccColName);
             return;
         }
-
-        for (String usedColumn : ccUsedColsMap.get(ccColNameWithoutDot)) {
+        for (String usedColumn : ccUsedColsMap.get(ccColName)) {
             collectCCUsedSourceCols(usedColumn, ccUsedColsMap, ccUsedSourceCols);
         }
     }