[Mondrian] ClassCastException w/ null members

Julian Hyde julianhyde at gmail.com
Thu Nov 14 17:40:13 EST 2013


On Nov 14, 2013, at 1:55 PM, Paul Stoellberger <p.stoellberger at gmail.com> wrote:

> Is there any news on this?
> 
> I just did some more tests with saiku on mondrian 4 but ran into the issue as well.
> Seems like its a blocker for using M4.

No news. I see that http://jira.pentaho.com/browse/MONDRIAN-1610 is on the 4.0 backlog. (By the way, can you add an MDX test case to that issue.)

I’m wondering whether the “simple fix”, to change

        final Comparable k1 = m1.getOrderKey();
        final Comparable k2 = m2.getOrderKey();
	if ((k1 != null) && (k2 != null)) {
            //noinspection unchecked                                                                                                                                                
            return k1.compareTo(k2);
        }

to

        final Comparable k1 = m1.getOrderKey();
        final Comparable k2 = m2.getOrderKey();
	if ((k1 != null) && (k2 != null) && k1.getClass() == k2.getClass()) {
            //noinspection unchecked                                                                                                                                                
            return k1.compareTo(k2);
        }
        .. some extra stuff to deal with heterogeneous keys, not invoked very often ...

would give the required flexibility to deal with “odd” members whose keys are of a different type than their siblings without making the typical case significantly more expensive.

Worth someone giving this a try.

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


More information about the Mondrian mailing list