[Mondrian] testLevelTableAttributeAsView failure question

Suki Hirata thirata at outlook.com
Mon Jan 12 17:56:14 EST 2015


Hi,
I am new to mondrian.  I am trying to make mondrian-4.1.1.0 branch work with postgres.  When I build, I get a test failure in testLevelTableAttributeAsView.  The error comes from the cube definition in the unit test generating the following sql statement:
  select "gender2"."gender" as "c0", sum("sales_fact_1997"."unit_sales") as "m0"  from "sales_fact_1997" as "sales_fact_1997", (        SELECT * FROM "customer"      ) as "gender2" where "sales_fact_1997"."customer_id" = "gender2"."gender" group by "c0"
While MySQL will ignore the type mismatch, Postgres does not like the "where" clause; it should really be "gender2"."customer_id" instead of "gender2"."gender".  In order to try to correct this, I changed the attribute in the cube from
    <Attribute name='Gender' keyColumn='gender'>
to 
    <Attribute name='Gender' nameColumn='gender' keyColumn='customer_id'>
But this is not generating the expected result because it generates the following sql:
  select "gender2"."customer_id" as "c0", sum("sales_fact_1997"."unit_sales") as "m0"  from "sales_fact_1997" as "sales_fact_1997", (        SELECT * FROM "customer"      ) as "gender2" where "sales_fact_1997"."customer_id" = "gender2"."customer_id" group by "c0"
Is this a cube definition problem or problem in the sql generation in mondrian?
Any help would be appreciated.
Thanks,
Suki

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20150112/5ce813ae/attachment.html 


More information about the Mondrian mailing list