[Mondrian] Problems when updating mondrian

Julian Hyde julianhyde at speakeasy.net
Tue Aug 7 14:41:24 EDT 2007


You can use the same table more than once in a schema, but you need to
manually assign them different aliases. By default the alias is the table
name, so in your example you will have two table usages whose alias is
'questions' (or in Spanish I guess 'preguntas').

The reason aliases need to be distinct is that we use them as the alias when
we generate a SQL statement (e.g. 'select ... from fact, questions as
preguntas1, questions as preguntas2 where fact.k1 = preguntas1.id_questions
and fact.k2 = preguntas2.id_questions group by ...')

So, just add the 'aliases' attribute:

>    <Table name="questions" alias="preguntas1"/>
...
>    <Table name="questions" alias="preguntas2"/>

By the way, this only half-worked in 2.2 and 2.3. For 2.4 we made the schema
validation rules stricter so that we would generate correct SQL in all
cases.

Julian

> -----Original Message-----
> From: mondrian-bounces at pentaho.org 
> [mailto:mondrian-bounces at pentaho.org] On Behalf Of miguel
> Sent: Tuesday, August 07, 2007 11:26 AM
> To: mondrian at pentaho.org
> Subject: [Mondrian] Problems when updating mondrian
> 
> What so.
> 
> I have mondrian 2,2 working with several cubes to my data base
> PostgreSQL.
> Now that I want to update it with mondrian 2,4, profit to pass
> everything of correct form, with the only exception of which 
> so it seems
> this new version
> does not allow me to have two or more dimensions bound to the 
> same table
> in the data base.
> This scheme works well in mondrian 2.2:
> 
>  <Dimension name="Have Product 1"
> caption="%{CubeA_Products.dimension.7}">
>   <Hierarchy hasAll="true" allMemberName="All Products 1"
> primaryKey="id_question">
>    <Table name="questions"/>
>    <Level name="P1" column="id_question" nameColumn="answer"
> ordinalColumn="answer" type="String" hideMemberIf="IfBlankName"
> uniqueMembers="true"/>
>   </Hierarchy>
>  </Dimension>
> 
>  <Dimension name="Have Product 2A"
> caption="%{CubeA_Products.dimension.8}">
>   <Hierarchy hasAll="true" allMemberName="All Products 2A"
> primaryKey="id_question">
>    <Table name="questions"/>
>    <Level name="P2A" column="id_question" nameColumn="answer"
> ordinalColumn="answer" type="String" hideMemberIf="IfBlankName"
> uniqueMembers="true"/>
>   </Hierarchy>
>  </Dimension>
> 
> This is the table in postgres:
> 
> cCubeA_Products=# SELECT * FROM questions;
>  id_questions | answer
> --------------+----------
>  313          | ----
>  314          | YES
>  315          | NO
> (3 rows)
> 
> My problem is that in the new version (2,4 mondrian), this is not
> accepted and it leaves the error to me: 
> 
>  javax.servlet.ServletException: javax.servlet.jsp.JspException:
> org.apache.jasper.JasperException:
>  javax.servlet.ServletException: javax.servlet.jsp.JspException:
> mondrian.olap.MondrianException:
>  Mondrian Error:Duplicate table alias 'preguntas' in cube
> 'CubeA_Products'
> 
> I do not want to use tables in-line, due to these reasons:
> 
>  - I do not want to slow down the cube
>  - I have at least other 15 cubes in the same situation
>  - I have to Kettle (ETTL), formed for the obtaining of each 
> one of the
> bases of these cubes
>  - To avoid the time that would take me to modify each cube in they
> mondrian and each process in Kettle, being one more a "elegant"
> solution. 
> 
> They can help me? 
> 
> NOTE. - I put as much this in the forum as in the list of 
> post office so
> that announcement was in this last one where the liberation.
> 
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
> 




More information about the Mondrian mailing list