【问题标题】:Multiple hierarchy in mondrian says Hierarchy not found蒙德里安的多个层次结构说没有找到层次结构
【发布时间】:2015-11-06 17:53:36
【问题描述】:

我在蒙德里安模式中有以下维度。蒙德里安在创建连接时说

mondrian.olap.MondrianException:蒙德里安错误:内部错误:找不到层次结构“[产品]”

<Dimension name="Product" foreignKey="item_id">
    <Hierarchy hasAll="true" primaryKey="item_code" primaryKeyTable="m_item_master">
        <Join leftKey="item_code" rightKey="item_code">
            <Table name="m_item_master"/> <!--dummy_master--> <!--m_item_master-->
            <Table name="m_item_relation"/>
        </Join>
        <Level name="Department" table="m_item_relation" column="department"/>
        <Level name="Class" table="m_item_relation" column="category"/>
        <Level name="Item" table="m_item_master" column="item_code" ordinalColumn="item_code" nameColumn="name" uniqueMembers="true" type="Numeric"/>
    </Hierarchy>

    <Hierarchy name="Base Item" hasAll="false" primaryKey="item_code" primaryKeyTable="m_item_master">
        <Join leftKey="item_code" rightKey="item_code">
            <Table name="m_item_master"/> <!--dummy_master--> <!--m_item_master-->
            <Table name="m_item_relation"/>
        </Join>
        <Level name="Department" table="m_item_relation" column="department" captionColumn="department"/>
        <Level name="Item" table="m_item_master" column="item_code" ordinalColumn="item_code" nameColumn="name" uniqueMembers="true" captionColumn="name" type="Numeric"/>
        <Property name="Price" table="m_item_master" column="price" />
    </Hierarchy>
</Dimension>

我正在使用 Mondrian-4.0.0-SNAPSHOT 版本,并尝试使用最新的 mondrian 4.2.0.0-204 版本。

注意: 此外,我在 mondrian 连接创建过程中遇到了这个错误。所以它不关心传递给它的任何 MDX 查询。

【问题讨论】:

    标签: schema pentaho mondrian


    【解决方案1】:

    好的。这就是我发现的错误。为了澄清起见,Mondrian 确实支持多层次结构,但对于上述架构,我们似乎对相关角色有不同的问题。

    <Role name="myrole">
        <SchemaGrant access="none">
            <CubeGrant cube="Transaction" access="all">
                <HierarchyGrant hierarchy="[Product]" access="custom" rollupPolicy="partial">
                    <MemberGrant member="[Product].[Cottage Foods]" access="all"/>
                    <MemberGrant member="[Product].[Vegetables]" access="all"/>
                    ....
                </HierarchyGrant>
                ....
            </CubeGrant>
        </SchemaGrant>
    </Role>
    

    在上述角色中,虽然默认层次结构采用 mondrian 中的维度名称,但如果维度中有多个层次结构,我们必须在角色中将它们指定为 [Dimension.Hierarchy] 而不仅仅是层次结构名称。在我们的例子中,它应该如下所示。

    <Role name="myrole">
        <SchemaGrant access="none">
            <CubeGrant cube="Transaction" access="all">
                <HierarchyGrant hierarchy="[Product.Product]" access="custom" rollupPolicy="partial">
                    <MemberGrant member="[Product.Product].[Cottage Foods]" access="all"/>
                    <MemberGrant member="[Product.Product].[Vegetables]" access="all"/>
                    ....
                </HierarchyGrant>
                ....
            </CubeGrant>
        </SchemaGrant>
    </Role>
    

    这样就解决了上面的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多