Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: parent child hierarchies error

  1. #1

    Default parent child hierarchies error

    I'm trying to define a schema with a level with parent - child hierarchy .
    when i execute the mdx query

    SELECT
    {[Measures].[QUANTITA]}
    ON COLUMNS,
    {Hierarchize(
    {[VOCI_D.VOCI_H].[All Voci],
    [VOCI_D.VOCI_H].[All Voci].Children})}
    ON ROWS
    FROM [CDG_COMMESSE]

    i get the error

    IndexOutOfBoundsException

    the complete log follows

    2013-02-13 17:11:09,819 DEBUG [mondrian.rolap.RolapConnection] select {[Measures].[QUANTITA]} ON COLUMNS,
    {Hierarchize({[VOCI_D.VOCI_H].[All Voci], [VOCI_D.VOCI_H].[All Voci].Children})} ON ROWS
    from [CDG_COMMESSE]


    2013-02-13 17:11:09,819 DEBUG [mondrian.mdx] 10: select {[Measures].[QUANTITA]} ON COLUMNS,
    {Hierarchize({[VOCI_D.VOCI_H].[All Voci], [VOCI_D.VOCI_H].[All Voci].Children})} ON ROWS
    from [CDG_COMMESSE]


    2013-02-13 17:11:09,829 DEBUG [mondrian.rolap.RolapCube] RolapCube.getUsages: name=Measures
    2013-02-13 17:11:09,829 DEBUG [mondrian.sql] 10: SqlMemberSource.getMemberChildren: executing sql [select "CDG_G_VOCINATU2"."ID" as "c0" from "OLAP_MONDRIAN"."CDG_G_VOCINATU2" "CDG_G_VOCINATU2" where "CDG_G_VOCINATU2"."PARENT_ID" IS NULL group by "CDG_G_VOCINATU2"."ID" order by "CDG_G_VOCINATU2"."ID" ASC]
    2013-02-13 17:11:09,829 DEBUG [mondrian.sql] 10: , exec 0 ms
    2013-02-13 17:11:09,829 DEBUG [mondrian.rolap.RolapUtil] SqlMemberSource.getMemberChildren: executing sql [select "CDG_G_VOCINATU2"."ID" as "c0" from "OLAP_MONDRIAN"."CDG_G_VOCINATU2" "CDG_G_VOCINATU2" where "CDG_G_VOCINATU2"."PARENT_ID" IS NULL group by "CDG_G_VOCINATU2"."ID" order by "CDG_G_VOCINATU2"."ID" ASC], exec 0 ms
    2013-02-13 17:11:09,829 DEBUG [mondrian.sql] 10: , exec+fetch 0 ms, 1 rows
    2013-02-13 17:11:09,829 DEBUG [mondrian.rolap.RolapUtil] SqlMemberSource.getMemberChildren: done executing sql [select "CDG_G_VOCINATU2"."ID" as "c0" from "OLAP_MONDRIAN"."CDG_G_VOCINATU2" "CDG_G_VOCINATU2" where "CDG_G_VOCINATU2"."PARENT_ID" IS NULL group by "CDG_G_VOCINATU2"."ID" order by "CDG_G_VOCINATU2"."ID" ASC], exec+fetch 0 ms, 1 rows
    2013-02-13 17:11:09,829 DEBUG [mondrian.olap.ResultBase] RolapResult<init>: FREE_MEMORY: 83670kb 84.50%
    2013-02-13 17:11:09,829 DEBUG [mondrian.mdx] 10: exec: 0 ms
    2013-02-13 17:11:09,829 ERROR [mondrian.gui.MdxQuery] SELECT
    {[Measures].[QUANTITA]}
    ON COLUMNS,
    {Hierarchize(
    {[VOCI_D.VOCI_H].[All Voci],
    [VOCI_D.VOCI_H].[All Voci].Children})}
    ON ROWS
    FROM [CDG_COMMESSE]


    mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while executing query [select {[Measures].[QUANTITA]} ON COLUMNS,
    {Hierarchize({[VOCI_D.VOCI_H].[All Voci], [VOCI_D.VOCI_H].[All Voci].Children})} ON ROWS
    from [CDG_COMMESSE]
    ]
    at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:826)
    at mondrian.olap.Util.newInternal(Util.java:1490)
    at mondrian.olap.Util.newError(Util.java:1506)
    at mondrian.rolap.RolapConnection.execute(RolapConnection.java:622)
    at mondrian.olap4j.MondrianOlap4jCellSet.execute(MondrianOlap4jCellSet.java:82)
    at mondrian.olap4j.MondrianOlap4jStatement.executeOlapQueryInternal(MondrianOlap4jStatement.java:320)
    at mondrian.olap4j.MondrianOlap4jStatement.executeOlapQuery(MondrianOlap4jStatement.java:289)
    at mondrian.gui.Workbench$OlapConnectionHolder.printQuery(Workbench.java:2673)
    at mondrian.gui.MdxQuery.executeButtonActionPerformed(MdxQuery.java:415)
    at mondrian.gui.MdxQuery.access$700(MdxQuery.java:39)
    at mondrian.gui.MdxQuery$8.actionPerformed(MdxQuery.java:335)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
    at java.util.ArrayList.RangeCheck(Unknown Source)
    at java.util.ArrayList.get(Unknown Source)
    at mondrian.rolap.SqlMemberSource.getMemberChildren2(SqlMemberSource.java:959)
    at mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:858)
    at mondrian.rolap.SqlMemberSource.getMemberChildren(SqlMemberSource.java:832)
    at mondrian.rolap.SmartMemberReader.readMemberChildren(SmartMemberReader.java:247)
    at mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:210)
    at mondrian.rolap.RolapCubeHierarchy$CacheRolapCubeHierarchyMemberReader.readMemberChildren(RolapCubeHierarchy.java:583)
    at mondrian.rolap.RolapCubeHierarchy$CacheRolapCubeHierarchyMemberReader.getMemberChildren(RolapCubeHierarchy.java:679)
    at mondrian.rolap.SmartMemberReader.getMemberChildren(SmartMemberReader.java:176)
    at mondrian.rolap.RolapSchemaReader.internalGetMemberChildren(RolapSchemaReader.java:173)
    at mondrian.rolap.RolapSchemaReader.getMemberChildren(RolapSchemaReader.java:155)
    at mondrian.rolap.RolapSchemaReader.getMemberChildren(RolapSchemaReader.java:149)
    at mondrian.olap.DelegatingSchemaReader.getMemberChildren(DelegatingSchemaReader.java:72)
    at mondrian.olap.fun.FunUtil.getNonEmptyMemberChildren(FunUtil.java:2071)
    at mondrian.olap.fun.BuiltinFunTable$22$1.evaluateMemberList(BuiltinFunTable.java:836)
    at mondrian.olap.fun.SetFunDef$MemberSetListCalc$1.evaluateVoid(SetFunDef.java:151)
    at mondrian.olap.fun.SetFunDef$MemberSetListCalc.evaluateMemberList(SetFunDef.java:190)
    at mondrian.olap.fun.HierarchizeFunDef$1.evaluateMemberList(HierarchizeFunDef.java:54)
    at mondrian.calc.impl.AbstractExpCompiler$MemberListIterCalc.evaluateMemberIterable(AbstractExpCompiler.java:597)
    at mondrian.calc.impl.AbstractMemberIterCalc.evaluate(AbstractMemberIterCalc.java:52)
    at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:732)
    at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:575)
    at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:541)
    at mondrian.rolap.RolapResult.<init>(RolapResult.java:273)
    at mondrian.rolap.RolapConnection.execute(RolapConnection.java:593)
    ... 43 m


    the tables of the dimension on a oracle database was

    CREATE TABLE OLAP_MONDRIAN.CDG_G_VOCINATU2 (
    ID VARCHAR2(128) NOT NULL,
    DESCRIPTION VARCHAR2(255) NULL,
    PARENT_ID VARCHAR2(128) NULL,
    CONSTRAINT PK_CDG_G_VOCINATU2_ID PRIMARY KEY(ID)
    NOT DEFERRABLE
    VALIDATE
    )

    the content was

    ID DESCRIPTION PARENT_ID
    ----------------------------- ----------------------------- --------------------------
    Ricavi da Interventi Ricavi da Interventi Redditivita
    Ricavi Commerciali Ricavi Commerciali Delta Commerciale
    Costi di Allestimento Costi di Allestimento Delta Service Allestimento
    Costi Commerciali Costi Commerciali Delta Commerciale
    Costi Intervento a Contratto Costi Intervento a Contratto Delta Contratto
    Costi di Intervento Fatturati Costi di Intervento Fatturati Redditivita
    Delta Service Allestimento Delta Service Allestimento Delta Contratto
    Delta Contratto Delta Contratto Redditivita
    Redditivita Redditivita (null)
    Delta Commerciale Delta Commerciale Delta Service Allestimento

    the schema definition was

    <Dimension type="StandardDimension" foreignKey="CDG_G_VOCINATU_ID" highCardinality="false" name="VOCI_D" caption="Voci" description="Voci">
    <Hierarchy name="VOCI_H" hasAll="true" allMemberName="All Voci" allMemberCaption="All Voci" primaryKey="ID" caption="All Voci">
    <Table name="CDG_G_VOCINATU2" schema="OLAP_MONDRIAN">
    </Table>
    <Level name="VOCI" column="ID" parentColumn="PARENT_ID" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never" captionColumn="DESCRIPTION">
    </Level>
    </Hierarchy>
    </Dimension>

    data and configuration seems correct .
    may be the structure of the table that it is incorrect ? ( the id and parent_id are string not integer)
    thanks for any answer

  2. #2

    Default

    Nothing seemingly bad with setup, so it is hidden effect.
    Suggest you try in this order:
    1. Eliminate captionColumn="DESCRIPTION" -- we had met strange behaviour of this element sometimes
    2. Try integer id_int and parent_int
    3. Add closure

  3. #3

    Default

    May be also worth trying this first:
    [VOCI_D.VOCI_H].[All Voci].Children --> [VOCI_D.VOCI_H].[All Voci].DefaultMember.Children

  4. #4

    Default

    The broblen was the captionColumn . If i remove it all is working well .
    instead of captionColum I can use NameColumn
    thanks for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.