You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by "xiejialong (Jira)" <ji...@apache.org> on 2022/12/01 13:23:00 UTC

[jira] [Created] (KYLIN-5327) kylin.cube.aggrgroup.is-mandatory-only-valid参数配置与Cuboid缺失

xiejialong created KYLIN-5327:
---------------------------------

             Summary: kylin.cube.aggrgroup.is-mandatory-only-valid参数配置与Cuboid缺失
                 Key: KYLIN-5327
                 URL: https://issues.apache.org/jira/browse/KYLIN-5327
             Project: Kylin
          Issue Type: Improvement
          Components: Modeling
    Affects Versions: v4.0.2
            Reporter: xiejialong
         Attachments: image-2022-12-01-21-16-08-040.png, image-2022-12-01-21-17-19-725.png

我在线上构建cube时发现必要维度的cuboid组合有时会不被构建。

只有当kylin.cube.aggrgroup.is-mandatory-only-valid=true时才会构建。可是kylin.cube.aggrgroup.is-mandatory-only-valid参数解释是:是否允许 Cube 只包含 Base Cuboid,默认值为 FALSE,当使用 Spark Cubing 时需设置为 TRUE。这个解释看起来有点抽象。

问题还原:

测试集的cube kylin_sales_model这个model构建以下的维度组合。 !image-2022-12-01-21-16-08-040.png|width=558,height=245!

当设置参数为false时 !image-2022-12-01-21-17-19-725.png|width=413,height=267! 会不构建必要维度的cuboid。

查看源码org.apache.kylin.cube.cuboid.DefaultCuboidScheduler#getOnTreeParents(long, org.apache.kylin.cube.model.AggregationGroup) 影响了cuboid的生成,如果为false
{code:java}
 if (agg.getMandatoryColumnMask() != 0L) {
            if (agg.isMandatoryOnlyValid()) {
                if (fillBit(tmpChild, agg.getMandatoryColumnMask(), parentCandidate)) {
                    return parentCandidate;
                }
            } else {
                tmpChild |= agg.getMandatoryColumnMask();
            }
        }        for (Long normal : agg.getNormalDims()) {
            fillBit(tmpChild, normal, parentCandidate);
        } {code}
会跳过必要组合作为LowestCuboid。



--
This message was sent by Atlassian Jira
(v8.20.10#820010)