[Mondrian] Fixing the broken SQL

Tom Barber(Alabs) tom at analytical-labs.com
Mon Jun 17 12:03:35 EDT 2013


Okay my fiddling around and brain dumps about aliasing got me thinking 
about the schema design, so I looked at the DTD and saw you could create 
extra tables with aliases. To my relief I found that if I duplicated the 
table and aliased it, suddenly Mondrian 4 stopped generating broken SQL.

Now this may be the design or it maybe an accident(personally I think it 
makes more sense to not have to alias), either way it'll work for now, 
but if its by design, i guess you need to create some catch mechanism 
for such cases.

(Updated working Foodmart attached to jira)

Tom

On 17/06/13 16:26, Tom Barber(Alabs) wrote:
> Okay after further thought, I guess it does need the alias as the 
> table could be included in the query twice with the 2 different 
> dimensions, so that begs the question, how to get it to map the 
> columns to the correct table then....
>
> On 17/06/13 16:19, Tom Barber(Alabs) wrote:
>> I've been doing some analysis on Mondrian-1611 basically, depending 
>> on how you look at it, its either creating a table alias it doesn't 
>> need(it really doesn't) within chooseAlias() in RolapStar because its 
>> already in the relation list, I guess because the table is referenced 
>> twice within the schema the Star analyser is mapping it twice.
>>
>> Or, if you think it needs the alias because the table is mapped 
>> twice, its then linking the rest of the query to the wrong from 
>> clause, i guess cause there are 2 in the list and all the other 
>> columns are linking to the non aliased
>>
>> Pointers or suggestions please :)
>



More information about the Mondrian mailing list