ResultSet.getCell picky about Position order

  • DWF

    DWF - 2012-05-24


    When trying out the OLAP4J Introduction v1.0 (apr 2011) example listing for
    "Iterating over results" on page 16 using OLAP4J with Mondrian
    3.4.2, the following line fails:

    3: Cell currentCell = results2.getCell( axis_0, axis_1 );

    with Error:

    java.lang.IndexOutOfBoundsException: Cell coordinates (0, 1) fall outside CellSet bounds (3, 1)
        at mondrian.olap4j.MondrianOlap4jCellSet.getCellInternal(

    However, switching the axes succeeds:

    3: Cell currentCell = results2.getCell( axis_1, axis_0 );

    Isn't the


    argument ordering of


    supposed to be figured out by OLAP4J and thus axis-independent?


  • Julian Hyde

    Julian Hyde - 2012-05-24

    The API doesn't specify whether CellSet.getCell(Position...) should expect the
    positions to be in a particular order. I think you are right -- it is
    reasonable to expect that the call should work if the positions are in any
    order, as long as the caller provides one for each axis.

    Can you please log a bug for this? Log it against olap4j, then we will add it
    to the TCK, and that will make sure that all drivers implement this
    functionality correctly.

  • Julian Hyde

    Julian Hyde - 2012-06-05

    I have logged bug 3532252.


Log in to post a comment.