[Mondrian] Native non empty evaluation with virtual cubes

Matt Campbell mkambol at gmail.com
Thu Jul 16 16:33:56 EDT 2009

We’re looking at an enhancement to native evaluation with virtual cubes and
are looking for feedback.

Right now native NON EMPTY evaluation with virtual cubes has a strict
restriction:  all measures in the query need to be on cubes that join to
each dimension in the crossjoin (see SqlContextConstraint.isValidContext).
So for example a query against [Warehouse and Sales] crossjoining Time and
Product would work fine, since both dimensions are present on both base
cubes.  The native code will create two SQL queries and UNION them
together—one to pull NON EMPTY members from the Sales fact table and one
from Warehouse.

For cases where there is a mixture of joining and non-joining dimensions the
native code will abort.  There is a comment in isValidContext that this is
done to avoid a querying for the Cartesian product with the non-joining
dim.  I think this is unnecessary, however.  For the non-joining
measure/dimension combination, *all* intersections will be empty.  This
means we can simply skip execution of the SQL to pull members for
non-joining dimension/fact table combination.

Here’s an example:

{ measures.[unit sales],  [Measures].[Units Shipped] } on 0,
NON EMPTY  Crossjoin({ [Promotion Media].[All Media].[Bulk Mail]},
[Product].[Product Category].members) on 1
from [warehouse and sales]

In this query Promotion Media and Product both apply to [units sales].  Only
Product applies to [Units Shipped], however.  Because of this, the results
of this query should be all NON EMPTY members that have [unit sales] data.
For native evaluation we can execute a SQL query joining the two dimensions
to Sales, and that alone should give the NON EMPTY tuples.

We’ve made the change locally and tests are passing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20090716/a3222874/attachment.html 

More information about the Mondrian mailing list