View Full Version : [Mondrian] RE: [ 1661288 ] NullPointerException inCellRequest.getSingleValues

Julian Hyde
03-27-2007, 01:40 PM
The 'isUnsatisfiable()' check seems to be the right approach. Is it
possible to do that logic without repeating a lot of computation? This
code is performance critical.

There is no need to make this easier to use for an end-user.
getSingleValues should only be called by mondrian internals. For that
reason, an assert is probably better than a MondrianException.

Because this code is internal, the only use case you need to worry about
is a particular MDX query. Note that SchemaTest has some examples of
tests which run MDX queries on slightly modified schemas. Using that
infrastructure, you should be able to write a unit test containing MDX
query which reliably fails.



> -----Original Message-----
> From: Will Gorman [mailto:wgorman (AT) pentaho (DOT) org]
> Sent: Tuesday, March 27, 2007 8:34 AM
> To: Julian Hyde
> Subject: [ 1661288 ] NullPointerException in
> CellRequest.getSingleValues
> Julian,
> [ 1661288 ] NullPointerException in CellRequest.getSingleValues
> In digging into this issue, the problem seems to be that the cell
> request is unsatisfiable. This causes a null item to be placed in the
> cell request's value list. getSingleValues assumes that there are no
> nulls. By adding an isUnsatisfiable() check in the
> RolapAggregationManager, who makes the call to
> getSingleValues, the null
> pointer is no longer happening. In addition to that check, I
> could also
> throw a mondrian exception if getSingleValues is called when
> the request
> is unsatisfiable, so in the future people know what is going
> on quicker.
> What do you think?
> Thanks!
> Will

Mondrian mailing list
Mondrian (AT) pentaho (DOT) org