Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Bug with NVARCHAR

  1. #1
    Join Date
    Mar 2017
    Posts
    8

    Default Bug with NVARCHAR

    If I have a field of nvarchar, I get the following:

    Caused by: mondrian.rolap.RolapSchema$MondrianSchemaException: Unknown data type nvarchar (-9) for column product of view; mondrian is probably not familiar with this database's type system (in Query) (at line 40, column 8)
    at mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning(RolapSchemaLoaderHandlerImpl.java:72)
    at mondrian.rolap.RolapSchemaLoaderHandlerImpl.warning(RolapSchemaLoaderHandlerImpl.java:62)
    at mondrian.rolap.RolapSchema$PhysSchema.describe(RolapSchema.java:1033)
    at mondrian.rolap.RolapSchema$PhysView.populateColumns(RolapSchema.java:1623)
    at mondrian.rolap.RolapSchema$PhysRelationImpl.ensurePopulated(RolapSchema.java:1519)
    at mondrian.rolap.RolapSchema$PhysView.ensurePopulated(RolapSchema.java:1561)
    at mondrian.rolap.RolapSchemaLoader.registerView(RolapSchemaLoader.java:1015)
    at mondrian.rolap.RolapSchemaLoader.validatePhysicalSchema(RolapSchemaLoader.java:740)
    at mondrian.rolap.RolapSchemaLoader.loadStage2(RolapSchemaLoader.java:376)
    at mondrian.rolap.RolapSchemaLoader.loadStage1(RolapSchemaLoader.java:336)
    at mondrian.rolap.RolapSchemaLoader.loadStage0(RolapSchemaLoader.java:272)
    at mondrian.rolap.RolapSchemaLoader.createSchema(RolapSchemaLoader.java:4303)
    at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:210)
    at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:62)
    at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:160)
    at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:84)
    at mondrian.olap.DriverManager.getConnection(DriverManager.java:112)
    at mondrian.olap.DriverManager.getConnection(DriverManager.java:68)
    at mondrian.olap4j.MondrianOlap4jConnection.<init>(MondrianOlap4jConnection.java:153)
    at mondrian.olap4j.FactoryJdbc4Plus$AbstractConnection.<init>(FactoryJdbc4Plus.java:323)
    at mondrian.olap4j.FactoryJdbc41Impl$MondrianOlap4jConnectionJdbc41.<init>(FactoryJdbc41Impl.java:118)
    at mondrian.olap4j.FactoryJdbc41Impl.newConnection(FactoryJdbc41Impl.java:32)
    at mondrian.olap4j.MondrianOlap4jDriver.connect(MondrianOlap4jDriver.java:139)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at net.datenwerke.rs.saiku.service.saiku.OlapUtilServiceImpl.getOlapConnection(OlapUtilServiceImpl.java:187)
    at net.datenwerke.rs.saiku.service.saiku.OlapUtilServiceImpl.getCube(OlapUtilServiceImpl.java:90)
    at net.datenwerke.rs.saiku.server.rest.resources.OlapDiscoverResource.getConnections(OlapDiscoverResource.java:119)
    ... 57 more
    [ERROR] 500 - GET /reportserver/rest/saiku/33282-6-1493295263769-657880097/discover?_=1493295265129 (127.0.0.1) 16997 bytes
    Request headers

    I solved it by changing:
    mondrian.spi.impl.JdbcDialectImpl.sqlTypeToDatatype() to:


    default:
    return Datatype.String;
    }

    So NVARCHAR is now recognized as String.

    Is this a bug? Using mondrian 4.3.0.1
    :

  2. #2
    Join Date
    Mar 2017
    Posts
    8

    Default

    The new method:

    public Datatype sqlTypeToDatatype(
    String typeName,
    int type)
    {
    Util.discard(typeName); // not used, but reserved for future use
    switch (type) {
    case Types.BINARY:
    // REVIEW: Access returns BINARY when it encounters a NULL; we can
    // treat that as any type, so we arbitrarily choose INTEGER.
    return Datatype.Integer;
    case Types.BIT:
    return Datatype.Integer;
    case Types.BOOLEAN:
    return Datatype.Boolean;
    case Types.DATE:
    return Datatype.Date;
    case Types.TINYINT:
    case Types.SMALLINT:
    case Types.INTEGER:
    case Types.BIGINT:
    return Datatype.Integer;
    case Types.NUMERIC:
    case Types.DECIMAL:
    case Types.FLOAT:
    case Types.DOUBLE:
    return Datatype.Numeric;
    case Types.CHAR:
    case Types.VARCHAR:
    return Datatype.String;
    case Types.TIME:
    return Datatype.Time;
    case Types.TIMESTAMP:
    return Datatype.Timestamp;
    default:
    return Datatype.String;
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.