[Mondrian] NON EMPTY + exception

Julian Hyde jhyde at pentaho.org
Fri Dec 21 02:04:43 EST 2007


Sherman/Agustin,
 
Can one of you please log a bug for this? I know I just removed the
getAlias() method that Sherman referred to, but I don't think I fixed the
bug. I'll need a testcase to make sure.
 
Sherman,
 
I've been trying to persuade someone to contribute a TPC-H test suite for a
long time, and it seems like you have one working. Can you contribute it? It
would serve as a good test of mondrian's scalability and (as this case
shows) would improve coverage on a very-snowflakey schema.
 
Julian


  _____  

From: Sherman Wood [mailto:swood at jaspersoft.com] 
Sent: Thursday, December 20, 2007 6:47 PM
To: jhyde at pentaho.org; 'Mondrian developer mailing list'; 'Agustin Campos'
Subject: RE: [Mondrian] NON EMPTY + exception



I have this issue too.

 

>From the TPC-H data set, I have a dimension:

 

            <Dimension type="StandardDimension" name="Customer">

                        <Hierarchy name="Customer" hasAll="true"
allMemberName="All Customers" primaryKey="o_orderkey"
primaryKeyTable="orders">

                                    <Join leftKey="o_custkey"
rightAlias="customer" rightKey="c_custkey">

                                                <Table name="orders">

                                                </Table>

                                                <Join leftAlias="customer"
leftKey="c_nationkey" rightAlias="c_nation" rightKey="n_nationkey">

                                                            <Table
name="customer">

                                                            </Table>

                                                            <Join
leftAlias="c_nation" leftKey="n_regionkey" rightAlias="c_region"
rightKey="r_regionkey">

 
<Table name="nation" alias="c_nation">

 
</Table>

 
<Table name="region" alias="c_region">

 
</Table>

                                                            </Join>

                                                </Join>

                                    </Join>

                                    <Level name="Region" table="c_region"
column="r_name" type="String" uniqueMembers="true" levelType="Regular"
hideMemberIf="Never">

                                    </Level>

                                    <Level name="Nation" table="c_nation"
column="n_name" type="String" uniqueMembers="true" levelType="Regular"
hideMemberIf="Never">

                                    </Level>

                                    <Level name="Customer" table="customer"
column="c_name" type="String" uniqueMembers="false" levelType="Regular"
hideMemberIf="Never">

                                    </Level>

                        </Hierarchy>

            </Dimension>

 

With the MDX:

 

select {[Measures].[Price]} on columns,

non empty crossjoin([Commit Date].[1998].Children, [Customer].[All
Customers].[AMERICA].[UNITED STATES].Children) ON rows

from Orders

 

I get:

 

Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error:
Populating member cache with members for [[Commit Date].[Month],
[Customer.Customer].[Customer]]

      at
mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:755)

      at mondrian.olap.Util.newInternal(Util.java:1103)

      at mondrian.olap.Util.newError(Util.java:1119)

      at
mondrian.rolap.SqlTupleReader.prepareTuples(SqlTupleReader.java:415)

      at mondrian.rolap.SqlTupleReader.readTuples(SqlTupleReader.java:441)

      at
mondrian.rolap.RolapNativeSet$SetEvaluator.executeList(RolapNativeSet.java:2
37)

      at
mondrian.rolap.RolapNativeSet$SetEvaluator.executeIterable(RolapNativeSet.ja
va:159)

      at
mondrian.rolap.RolapNativeSet$SetEvaluator.execute(RolapNativeSet.java:142)

      at
mondrian.olap.fun.CrossJoinFunDef$BaseIterCalc.evaluateIterable(CrossJoinFun
Def.java:241)

      at
mondrian.calc.impl.AbstractIterCalc.evaluate(AbstractIterCalc.java:53)

      at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:715)

      at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:587)

      at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:565)

      at mondrian.rolap.RolapResult.<init>(RolapResult.java:251)

      at mondrian.rolap.RolapConnection.execute(RolapConnection.java:414)

      ... 27 more

Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error:
join does not have alias

      at
mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:752)

      at mondrian.olap.Util.newInternal(Util.java:1096)

      at mondrian.olap.MondrianDef$Join.getAlias(MondrianDef.java:2176)

      at
mondrian.rolap.RolapHierarchy.rewriteRelationWithAliases(RolapHierarchy.java
:635)

      at
mondrian.rolap.RolapHierarchy.relationSubset(RolapHierarchy.java:554)

      at
mondrian.rolap.RolapHierarchy.lookupRelationSubset(RolapHierarchy.java:591)

      at
mondrian.rolap.RolapHierarchy.relationSubset(RolapHierarchy.java:548)

      at mondrian.rolap.RolapHierarchy.addToFrom(RolapHierarchy.java:486)

      at
mondrian.rolap.SqlTupleReader.addLevelMemberSql(SqlTupleReader.java:747)

      at
mondrian.rolap.SqlTupleReader.generateSelectForLevels(SqlTupleReader.java:66
6)

      at
mondrian.rolap.SqlTupleReader.makeLevelMembersSql(SqlTupleReader.java:633)

      at
mondrian.rolap.SqlTupleReader.prepareTuples(SqlTupleReader.java:329)

      ... 38 more

 

This is happening at the point where we are going from the lowest level join
(nation, region) up to the next join with customer.

 

mondrian.native.nonempty.enable=false does not help.

 

 

The structure in Mondrian HEAD is different, so now it does not make a call
to MondrianDef$Join.getAlias. The problem is there in Mondrian 2.3.2.

 

A fix I found was to change Mondrian.xml in the <Code> for the Join element:

 

            public String getAlias() {

                //throw Util.newInternal("join does not have alias");

                  return getLeftAlias();

            }

 

Change this line, and recompile the Mondrian.jar.

 

Sherman


  _____  


From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On
Behalf Of Julian Hyde
Sent: Wednesday, December 12, 2007 7:10 PM
To: 'Agustin Campos'
Cc: 'Mondrian developer mailing list'
Subject: RE: [Mondrian] NON EMPTY + exception

 

An error stack would help. I would like to see where
MondrianDef.Join.getAlias() is being called from.

 

I am guessing you have a snowflake schema?

 

Also, you should be able to work around this problem by setting
mondrian.native.nonempty.enable=false in mondrian.properties.

 

Julian

 


  _____  


From: Agustin Campos [mailto:aguscampos at gmail.com] 
Sent: Wednesday, December 12, 2007 12:04 AM
To: jhyde at pentaho.org; Mondrian developer mailing list
Subject: Re: [Mondrian] NON EMPTY + exception

all <join ...> has their own alias (tables' names on database) 
<join leftAlias... rightAlias... >
   < table name="table1" />
  <join ...>
       ...
      ....
   </join> 
</join>

All <join > has their own alias (left and right). 
<Table ....> doesn't.

Thanks for your answer, but, do you have any more ideas?




2007/12/12, Julian Hyde <jhyde at pentaho.org>: 

Heed the error message "join does not have alias" - check all <Join>
elements in your schema and make sure that specify leftAlias and rightAlias,
to make the join unambiguous.

 


  _____  


From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On
Behalf Of Agustin Campos
Sent: Tuesday, December 11, 2007 11:15 PM
To: Mondrian developer mailing list
Subject: [Mondrian] NON EMPTY + exception

Hello all:

I am having a little problem with my cube. It has 3 dimensions.

The case is that, when I ask something like this:

select NON EMPTY Crossjoin(Hierarchize(Union({[Dim1].[All]},
[Dim1].[All].Children)), {[Dim2].[All]}) ON COLUMNS, 
  NON EMPTY {[Dim3].[All]} ON ROWS
from [MyCube]

and then, I expand Dim1 I get an exception like this:

SqlMemberSource.getMemberChildren: executing sql [ SQL query ], exec 46 ms,
exec+fetch 46 ms, 7 rows
com.tonbeller.jpivot.olap.model.OlapException:
mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while
executing query: MDX query which should work 

...
...
...
...

Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error:
join does not have alias
...
...
...

Do you have any idea about what could cause this problem? I know that I have
not sent the complete log but, I hope this could help to troubleshoot the
problem. 

I remind: It ONLY happends when I ask for non empty cells. It DOES WORK when
they are allowd.


Thank you a lot:

Agustín




_______________________________________________
Mondrian mailing list
Mondrian at pentaho.org
http://lists.pentaho.org/mailman/listinfo/mondrian




-- 
Agustín Campos Muñoz
http://www.acampos.net

Email: aguscamposENgmailPUNTOcom 
           acamposENiiesPUNTOes
MSN Messenger: acampozENhotmailPUNTOcom
Skype: acamposnet 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20071220/2886542f/attachment.html 


More information about the Mondrian mailing list