[Mondrian] ClassCastException w/ null members

Matt Campbell mcampbell at pentaho.com
Fri Nov 15 08:55:06 EST 2013


Your simple fix does appear to do the trick.  If there are no objections I'll test a bit more and commit the change.


On 11/14/2013 05:40 PM, Julian Hyde wrote:
On Nov 14, 2013, at 1:55 PM, Paul Stoellberger <p.stoellberger at gmail.com<mailto: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/20131115/e183469f/attachment.html 


More information about the Mondrian mailing list