mondrian 连接hive 步骤
修改的配置
saiku中的mondrian.prepoerties
mondrian.jdbcDrivers=org.apache.hadoop.hive.jdbc.HiveDriver
样例:
ondrian.catalogURL=file:///Users/xiedandan/Documents/workspace/mondrian_source/demo/Test.xml
mondrian.jdbcDrivers=org.apache.hadoop.hive.jdbc.HiveDriver
mondrian.foodmart.jdbcURL=jdbc:hive://test-inc.cn:10000/test;
# to specify the jdbc username and password:
# mondrian.test.jdbcUser=foodmart
# mondrian.test.jdbcPassword=foodmart
# Use MD5 based caching for the RolapSchema instance
mondrian.catalog.content.cache.enabled=true
# both read and use aggregate tables
mondrian.rolap.aggregates.Use=true
mondrian.rolap.aggregates.Read=true
# generate aggregate sql (for every mdx query)
mondrian.rolap.aggregates.generateSql=true
# pretty print sql (if log level for mondrian.rolap.RolapUtil is DEBUG)
mondrian.rolap.generate.formatted.sql=true
# by default the aggregate table with the smallest number of rows
# (rather than rows times size of each row) is used
mondrian.rolap.aggregates.ChooseByVolume=true
java gave the error when connecting hive: thread pool error,why? Using olap4j will not get this error.
错误如下:
Exception in thread “main” mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while creating SQL connection: Jdbc=jdbc:hive://domob-203.domob-inc.cn:20000/rtb;
at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:977)
at mondrian.olap.Util.newInternal(Util.java:2404)
at mondrian.olap.Util.newError(Util.java:2420)
at mondrian.rolap.RolapConnection.(RolapConnection.java:246)
at mondrian.rolap.RolapSchema.(RolapSchema.java:188)
at mondrian.rolap.RolapSchema.(RolapSchema.java:216)
at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:215)
at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:67)
at mondrian.rolap.RolapConnection.(RolapConnection.java:160)
at mondrian.rolap.RolapConnection.(RolapConnection.java:90)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:113)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:69)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:51)
at mondrian.tui.CmdRunner.getConnection(CmdRunner.java:767)
at mondrian.tui.CmdRunner.getConnection(CmdRunner.java:753)
at mondrian.tui.CmdRunner.getCubes(CmdRunner.java:460)
at mondrian.tui.CmdRunner.listCubeName(CmdRunner.java:475)
at mondrian.tui.CmdRunner.executeCube(CmdRunner.java:2084)
at mondrian.tui.CmdRunner.commandLoop(CmdRunner.java:948)
at mondrian.tui.CmdRunner.commandLoop(CmdRunner.java:844)
at mondrian.tui.CmdRunner.main(CmdRunner.java:2558)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103)
at mondrian.rolap.RolapConnection.(RolapConnection.java:226)
… 17 more
Caused by: java.util.NoSuchElementException: Could not create a validated object, cause: Method not supported
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:806)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
… 18 more