[Mondrian] Some SQL points

Julian Hyde jhyde at pentaho.com
Mon Mar 16 01:43:11 EDT 2009


> Stefan de Konink wrote:
>
> Niels Nes SQL developer at the CWI for MonetDB made some serious 
> progress in supporting Mondrian.

Good to hear that.

> Some thing that I would like to highlight:
> select something from (select somethingelse from different);
> 
> I have heard from the specs that should have AS newthing:
> select this from (select that from different) AS newthing;

I checked SQL:2008 and you are correct; in standard SQL a query is not valid
unless the subquery has an alias. However, most databases allow with and
without, so we made it an option in mondrian's dialect.

Make Dialect.requiresAliasForFromQuery() return 'true' in your dialect, and
mondrian should generate the correct SQL.

> There are some more test failing related to order by and 
> queries I don't 
> understand:
> 
>       [java] SELECT {[Promotions].[Bag Stuffers], [Promotions].[Best 
> Savings], [Promotions].[Average]} ON AXIS(0),
>       [java]        {[Store].[All Stores].[USA], [Store].[All 
> Stores].[USA].Children} ON AXIS(1)
>       [java] FROM [Sales]'

Can you post more information about what is going wrong with those queries?
What is the SQL that is failing? Although [Promotions].[Average] is a
calculated member, I can't see it needing ORDER BY. However, some of the
code to load dimension members includes GROUP BY and ORDER BY in queries.

Julian





More information about the Mondrian mailing list