[Mondrian] Iterable ResultStyle vs List ResultStyle

Julian Hyde julianhyde at speakeasy.net
Tue Sep 4 18:38:33 EDT 2007


 



Robin Tharappel wrote:
  

In reviewing tracker 1755778 (Cross Join with Filter returns empty result
set), it appears that the type of ResultStyle impacts the result set
returned in some cases. Using JDK 1.5 the Iterable ResultStyle will be used
and the List ResultStyle will be used with JDK 1.4.  Given the following
MDX:

 

WITH SET [#DataSet#] as 'Filter(Crossjoin({[Store].[All Stores]},
{[Customers].[All Customers]}), 
[Measures].[Unit Sales] > 0)' 
SELECT {[Measures].[Unit Sales]} ON COLUMNS, 
{[#DataSet#] } ON ROWS FROM Sales

 

 

Using the Iterable ResultStyle (with JDK 1.5) an empty result set is
returned. However if I force the ResultStyle to List the correct result set
is returned. It appears that the List implementation is evaluating the
expressions while the list is created.  The Iterable implementation
evaluates the expressions during iteration. Should the Iterable ResultStyle
evaluate the expressions when it is created (similar to the List
ResultStyle) ?   

 

Well, the result should certainly be the same, whichever result style is
used. I think (not having looked at the code) that the problem you're seeing
is in the Iterable ResultStyle implementation of the Filter function. The
semantics of the Filter function are that the boolean expression is
evaluated in the context of each successive member from the list expression.
If Iterable ResultStyle doesn't implement those semantics, it's a bug.

 

Note that the CrossJoin function has different semantics: each of the
arguments should be evaluated independently.

 

Julian

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


More information about the Mondrian mailing list