java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4)

Pentaho BI Platform Tracking | Prohaska Andreas | 2 years ago
  1. 0

    Hi! I'm using an embedded Mondrian 3.6.1 together with Pivot4J 0.9 to build a very simple OLAP web application. When performing drill through operations an exception occurs if a cell is addressed with its ordinal number and a NonEmpty clause is present in the MDX statement. In my case, the exception occurs because the ordinal number references a Cell that is beyond the dimensions of the result. However, the problem also exists for ordinal numbers within the given range as a wrong cell could be returned by CellSet.getCell(int). By default, the Pivot4J API uses the Cell ordinal as parameter to identify the cell to drill through in subsequent requests. If there is no NonEmpty clause everything works fine. A dump of a result with 2 columns and 6 rows prints the following cell coordinates and their ordinals: [0, 0] 0 [1, 0] 1 [0, 1] 2 [1, 1] 3 [0, 2] 4 [1, 2] 5 [0, 3] 6 [1, 3] 7 [0, 4] 8 [1, 4] 9 [0, 5] 10 [1, 5] 11 If I include a NonEmpty clause in the same statement, the cell coordinates are correct, but the ordinal numbers are not changed. In this example the rows with number 1 and 3 are empty. [0, 0] 0 [1, 0] 1 [0, 1] 4 [1, 1] 5 [0, 2] 8 [1, 2] 9 [0, 3] 10 [1, 3] 11 However, if I call MondrianOlap4JCellSet.getCell(8) the operation results in an exception: java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4) at mondrian.olap4j.MondrianOlap4jCellSet.ordinalToCoordinateArray(MondrianOlap4jCellSet.java:152) at mondrian.olap4j.MondrianOlap4jCellSet.getCell(MondrianOlap4jCellSet.java:138) Looking into the code some more, the first call to MondrianOlap4JCell.getOrdinal() finally results in mondrian.rolap.RolapResult.getCellOrdinal(int[]) being called. This results *includes* the empty rows. The later call to MondrianOlap4JCellSet.getCell(int) uses the private method int[] ordinalToCoordinateArray(int) to compute the coordinates. In this method result.getAxes() is used to get the axes and their sizes. However, the instance of "result" is RolapConnection$NonEmptyResult(ResultBase) and this result no longer contains the empty rows. Thus, the ordinal 8 is out of range. I think that MondrianOlap4JCell.getOrdinal() should not compute the ordinal number on the result that includes the empty rows.

    Pentaho BI Platform Tracking | 2 years ago | Prohaska Andreas
    java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4)
  2. 0

    Hi! I'm using an embedded Mondrian 3.6.1 together with Pivot4J 0.9 to build a very simple OLAP web application. When performing drill through operations an exception occurs if a cell is addressed with its ordinal number and a NonEmpty clause is present in the MDX statement. In my case, the exception occurs because the ordinal number references a Cell that is beyond the dimensions of the result. However, the problem also exists for ordinal numbers within the given range as a wrong cell could be returned by CellSet.getCell(int). By default, the Pivot4J API uses the Cell ordinal as parameter to identify the cell to drill through in subsequent requests. If there is no NonEmpty clause everything works fine. A dump of a result with 2 columns and 6 rows prints the following cell coordinates and their ordinals: [0, 0] 0 [1, 0] 1 [0, 1] 2 [1, 1] 3 [0, 2] 4 [1, 2] 5 [0, 3] 6 [1, 3] 7 [0, 4] 8 [1, 4] 9 [0, 5] 10 [1, 5] 11 If I include a NonEmpty clause in the same statement, the cell coordinates are correct, but the ordinal numbers are not changed. In this example the rows with number 1 and 3 are empty. [0, 0] 0 [1, 0] 1 [0, 1] 4 [1, 1] 5 [0, 2] 8 [1, 2] 9 [0, 3] 10 [1, 3] 11 However, if I call MondrianOlap4JCellSet.getCell(8) the operation results in an exception: java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4) at mondrian.olap4j.MondrianOlap4jCellSet.ordinalToCoordinateArray(MondrianOlap4jCellSet.java:152) at mondrian.olap4j.MondrianOlap4jCellSet.getCell(MondrianOlap4jCellSet.java:138) Looking into the code some more, the first call to MondrianOlap4JCell.getOrdinal() finally results in mondrian.rolap.RolapResult.getCellOrdinal(int[]) being called. This results *includes* the empty rows. The later call to MondrianOlap4JCellSet.getCell(int) uses the private method int[] ordinalToCoordinateArray(int) to compute the coordinates. In this method result.getAxes() is used to get the axes and their sizes. However, the instance of "result" is RolapConnection$NonEmptyResult(ResultBase) and this result no longer contains the empty rows. Thus, the ordinal 8 is out of range. I think that MondrianOlap4JCell.getOrdinal() should not compute the ordinal number on the result that includes the empty rows.

    Pentaho BI Platform Tracking | 2 years ago | Prohaska Andreas
    java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4)
  3. 0

    ResultSet.getCell picky about Position order

    olap4j | 5 years ago | krevelen
    java.lang.IndexOutOfBoundsException: Cell coordinates (0, 1) fall outside CellSet bounds (3, 1)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SVNKit java.lang.IndexOutOfBoundsException

    Stack Overflow | 10 months ago | markus
    java.lang.IndexOutOfBoundsException: Bounds exceeds available space : size=7, offset=8
  6. 0

    VARIANT[] array corruption occures by calling Oleacc -> AccessibleChildren method

    Google Groups | 2 years ago | j r
    java.lang.IndexOutOfBoundsException: Bounds exceeds available space : size=8, offset=16

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IndexOutOfBoundsException

      Cell ordinal 8) lies outside CellSet bounds (2, 4)

      at mondrian.olap4j.MondrianOlap4jCellSet.ordinalToCoordinateArray()
    2. mondrian.olap4j
      MondrianOlap4jCellSet.getCell
      1. mondrian.olap4j.MondrianOlap4jCellSet.ordinalToCoordinateArray(MondrianOlap4jCellSet.java:152)
      2. mondrian.olap4j.MondrianOlap4jCellSet.getCell(MondrianOlap4jCellSet.java:138)
      2 frames