Pentaho Analysis - Mondrian
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-831

Failure parsing queries with member identifiers beginning with '_' and not expressed between brackets

    Details

      Description

      Hello,

      Using Mondrian MDX parsing capabilities with our OLAP server ActivePivot, we are facing issues with a new feature in Excel 2010. Dynamic slicers generates queries like:

      with
      member [Measures].__XLChildrenCount as [Store].[Stores].currentmember.children.Count
      select { [Store].[Stores].[All Stores] } on 1,
      { [Measures].__XLChildrenCount } on 0
      from [Sales and Employees]
      cell properties value

      To express a member with a syntax like [Measures].__XLChildrenCount is valid following microsoft documentation (http://msdn.microsoft.com/en-us/library/ms145572.aspx). But Mondrian 3.0.4 accepts only identifiers beginning with a word character (when not expressed between brackets).

      This can be be fixed by simply adding the right case in the right switch:

      In mondrian.olap.Scanner, add case '_' after line 614. It could give something like:

      Symbol mondrian.olap.Scanner.next_token() throws IOException {
         ...
                  case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
                  case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
                  case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
                  case 's': case 't': case 'u': case 'v': case 'w': case 'x':
                  case 'y': case 'z':
                  case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
                  case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
                  case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
                  case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
                  case 'Y': case 'Z':
                  // [QFS]: '_' is a valid character for the first character of an identifier (http://msdn.microsoft.com/en-us/library/ms145572.aspx)
                  case '_':
                      /* parse an identifier */
                      id = new StringBuilder();
                      for (;;) {
                          id.append((char)nextChar);
                          advance();
                          switch (nextChar) {
                          case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
                          case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':

      Thanks!

        Activity

        Hide
        Julian Hyde added a comment -
        Fixed in eigenbase change 13902.
        Also fixed in olap4j's parser, revision 365.
        Show
        Julian Hyde added a comment - Fixed in eigenbase change 13902. Also fixed in olap4j's parser, revision 365.
        Hide
        Golda David added a comment -
        Tested this issue and the _ appears in ' '
        Show
        Golda David added a comment - Tested this issue and the _ appears in ' '
        Hide
        Golda David added a comment -
        Tested this issue using the latest build for Mondrian 33 and this issue is resolved.
        Show
        Golda David added a comment - Tested this issue using the latest build for Mondrian 33 and this issue is resolved.

          People

          • Assignee:
            Golda David
            Reporter:
            Benoît Lacelle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified