mondrian.rolap.RolapSchema$MondrianSchemaException: Key must have precisely one column; key [number.prefix, number.national_significant_number] in table 'number'. (in Key) (at line 32, column 12)

Pentaho BI Platform Tracking | Hadrien Kohl | 3 years ago
  1. 0

    Hi, I'm not sure I understood the way one should declare a composite key with the version 4's new schema, so this might just be a mistake from my side. I've been reading that composite key are supported starting from 4.0.0 on the Internet (and also here MONDRIAN-630), so I tried running the latest snapshot. I'm defining my table as follow: <Table name='number'> <Key name='pk_number'> <Column name='prefix'/> <Column name='national_significant_number'/> </Key> </Table> However, when I load the scheman, I can see the following exception: <pre>mondrian.rolap.RolapSchema$MondrianSchemaException: Key must have precisely one column; key [number.prefix, number.national_significant_number] in table 'number'. (in Key) (at line 32, column 12) at mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning(RolapSchemaLoaderHandlerImpl.java:72) at mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning(RolapSchemaLoaderHandlerImpl.java:62) at mondrian.rolap.RolapSchemaLoader.registerKey(RolapSchemaLoader.java:1270) at mondrian.rolap.RolapSchemaLoader.registerTable(RolapSchemaLoader.java:1057) at mondrian.rolap.RolapSchemaLoader.validatePhysicalSchema(RolapSchemaLoader.java:699) at mondrian.rolap.RolapSchemaLoader.loadStage2(RolapSchemaLoader.java:364) at mondrian.rolap.RolapSchemaLoader.loadStage1(RolapSchemaLoader.java:324) at mondrian.rolap.RolapSchemaLoader.loadStage0(RolapSchemaLoader.java:260) [...] </pre> I took a look at the code and I found this: <pre> if (key.columnList.size() != 1) { handler.warning( "Key must have precisely one column; key " + key.columnList + " in table '" + physTable.alias + "'.", xmlKey, null); } </pre> https://github.com/pentaho/mondrian/blob/lagunitas/src/main/mondrian/rolap/RolapSchemaLoader.java#L1268 I seems to me that this test will always fails, thus that the composite key are in fact not supported yet. Am I right? Another point I think of as I wrote, this is sent to the handler as a warning. How comes it crashes the entire process then? Best, Hadrien

    Pentaho BI Platform Tracking | 3 years ago | Hadrien Kohl
    mondrian.rolap.RolapSchema$MondrianSchemaException: Key must have precisely one column; key [number.prefix, number.national_significant_number] in table 'number'. (in Key) (at line 32, column 12)
  2. 0

    Hi, I'm not sure I understood the way one should declare a composite key with the version 4's new schema, so this might just be a mistake from my side. I've been reading that composite key are supported starting from 4.0.0 on the Internet (and also here MONDRIAN-630), so I tried running the latest snapshot. I'm defining my table as follow: <Table name='number'> <Key name='pk_number'> <Column name='prefix'/> <Column name='national_significant_number'/> </Key> </Table> However, when I load the scheman, I can see the following exception: <pre>mondrian.rolap.RolapSchema$MondrianSchemaException: Key must have precisely one column; key [number.prefix, number.national_significant_number] in table 'number'. (in Key) (at line 32, column 12) at mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning(RolapSchemaLoaderHandlerImpl.java:72) at mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning(RolapSchemaLoaderHandlerImpl.java:62) at mondrian.rolap.RolapSchemaLoader.registerKey(RolapSchemaLoader.java:1270) at mondrian.rolap.RolapSchemaLoader.registerTable(RolapSchemaLoader.java:1057) at mondrian.rolap.RolapSchemaLoader.validatePhysicalSchema(RolapSchemaLoader.java:699) at mondrian.rolap.RolapSchemaLoader.loadStage2(RolapSchemaLoader.java:364) at mondrian.rolap.RolapSchemaLoader.loadStage1(RolapSchemaLoader.java:324) at mondrian.rolap.RolapSchemaLoader.loadStage0(RolapSchemaLoader.java:260) [...] </pre> I took a look at the code and I found this: <pre> if (key.columnList.size() != 1) { handler.warning( "Key must have precisely one column; key " + key.columnList + " in table '" + physTable.alias + "'.", xmlKey, null); } </pre> https://github.com/pentaho/mondrian/blob/lagunitas/src/main/mondrian/rolap/RolapSchemaLoader.java#L1268 I seems to me that this test will always fails, thus that the composite key are in fact not supported yet. Am I right? Another point I think of as I wrote, this is sent to the handler as a warning. How comes it crashes the entire process then? Best, Hadrien

    Pentaho BI Platform Tracking | 3 years ago | Hadrien Kohl
    mondrian.rolap.RolapSchema$MondrianSchemaException: Key must have precisely one column; key [number.prefix, number.national_significant_number] in table 'number'. (in Key) (at line 32, column 12)
  3. 0

    Mondrian 4: JDBC columns with Types.Real data type return null Schema won't load.

    GitHub | 1 month ago | chubbard
    mondrian.rolap.RolapSchema$MondrianSchemaException: Unknown data type FLOAT (7) for column latitude of view; mondrian is probably not familiar with this database's type system (in Query) (at line 18, column 8)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. mondrian.rolap.RolapSchema$MondrianSchemaException

      Key must have precisely one column; key [number.prefix, number.national_significant_number] in table 'number'. (in Key) (at line 32, column 12)

      at mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning()
    2. mondrian.rolap
      RolapSchemaLoader.loadStage0
      1. mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning(RolapSchemaLoaderHandlerImpl.java:72)
      2. mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning(RolapSchemaLoaderHandlerImpl.java:62)
      3. mondrian.rolap.RolapSchemaLoader.registerKey(RolapSchemaLoader.java:1270)
      4. mondrian.rolap.RolapSchemaLoader.registerTable(RolapSchemaLoader.java:1057)
      5. mondrian.rolap.RolapSchemaLoader.validatePhysicalSchema(RolapSchemaLoader.java:699)
      6. mondrian.rolap.RolapSchemaLoader.loadStage2(RolapSchemaLoader.java:364)
      7. mondrian.rolap.RolapSchemaLoader.loadStage1(RolapSchemaLoader.java:324)
      8. mondrian.rolap.RolapSchemaLoader.loadStage0(RolapSchemaLoader.java:260)
      8 frames