pentaho / mondrian

Mondrian is an Online Analytical Processing (OLAP) server that enables business users to analyze large quantities of data in real-time.

Home Page:http://mondrian.pentaho.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NullPointerException in Sorter.logTuples

SergeySD opened this issue · comments

In OrderFunDef.evaluateList there is code that makes all lists except ArrayTupleList null

    public TupleList evaluateList( Evaluator evaluator ) {
      evaluator.getTiming().markStart( TIMING_NAME );
      try {
        final TupleIterable iterable = iterCalc.evaluateIterable( evaluator );
        // REVIEW: If iterable happens to be a list, we'd like to pass it,
        // but we cannot yet guarantee that it is mutable.
        final TupleList list = iterable instanceof ArrayTupleList && false ? (TupleList) iterable : null;
        // go by size of keySpecList before purging

and if logging enabled this null pass to Sorter.LogTuples and create NullPointerException.

I can't understand how to fix it better, should I add a check for null in LogTuples, or OrderFunDef works incorrectly.