PDA

View Full Version : Help connecting Mondrian and Hive



ng_and
10-24-2011, 10:41 AM
Hi guys,

I am super new at this, so please bear with me.
I wanted to play around with Mondrian and see if I could get it working with Hive. So I downloaded the latest Mondrian source code from perforce and set everything up. When I used the Foodmart database with MySQL and tested it with the provided test cases in eclipse, everything works fine. I have now loaded the Foodmart into Hive but the problem is I am having problems trying to connect to Hive. Here is my setup:

Mondrian.properties:

mondrian.foodmart.jdbcURL=jdbc:hive://localhost:10000/default
mondrian.foodmart.jdbcUser=
mondrian.foodmart.jdbcPassword=
mondrian.jdbcDrivers=org.apache.hadoop.hive.jdbc.HiveDriver

driver.classpath=/users/andy/desktop/hiveMond/open/mondrian/testlib/hive-jdbc-0.7.1.jar;/users/andy/desktop/hiveMond/open/mondrian/testlib/hive-metastore-0.7.1.jar;/users/andy/desktop/hiveMond/open/mondrian/testlib/libthrift.jar;/users/andy/desktop/hiveMond/open/mondrian/testlib/hive-exec-0.7.1;/users/andy/desktop/hiveMond/open/mondrian/testlib/hive-service-0.7.1.jar;/users/andy/desktop/hiveMond/open/mondrian/testlib/libfb303.jar;/users/andy/desktop/hiveMond/open/mondrian/testlib/hadoop-0.20.0-core.jar;/users/andy/desktop/hiveMond/open/mondrian/testlib/slf4j-log4j12-1.6.1.jar;/users/andy/desktop/hiveMond/open/mondrian/testlib/slf4j-api-1.6.1.jar

mondrian.catalogURL=/users/andy/desktop/hiveMond/open/mondrian/demo/FoodMart.xml
mondrian.test.jdbcURL=jdbc:mysql://localhost:10000/default



/////////////////////////////////////////////



I know I am not able to connect because I am getting errors like:


mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while creating SQL connection: Jdbc=jdbc:hive://localhost:10000/default; JdbcUser=; JdbcPassword=
at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:912)
at mondrian.olap.Util.newInternal(Util.java:2038)
at mondrian.olap.Util.newError(Util.java:2054)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:254)
at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:196)
at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:239)
at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:233)
at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:1121)
at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:913)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:153)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:88)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:115)
at mondrian.test.TestContext.getConnection(TestContext.java:228)
at mondrian.rolap.HighDimensionsTest.testBug1971406(HighDimensionsTest.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
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.<init>(RolapConnection.java:217)
... 30 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)
... 31 more


If anyone could help that would be great. Thanks!

ng_and
10-25-2011, 12:08 PM
I changed the catch clause to where it is throwing the exception to print out the error message and now I am getting:


mondrian.olap.MondrianException: Mondrian Error:Internal error: Cannot get a connection, pool exhausted
at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:909)
at mondrian.olap.Util.newInternal(Util.java:2031)
at mondrian.olap.Util.newError(Util.java:2046)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:272)
at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:196)
at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:239)
at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:233)
at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:1121)
at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:913)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:160)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:89)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:116)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:71)
at mondrian.rolap.RolapConnectionTest$2.getConnection(RolapConnectionTest.java:229)
at mondrian.test.TestContext.executeQuery(TestContext.java:479)
at mondrian.test.TestContext.executeExprRaw(TestContext.java:741)
at mondrian.test.TestContext.assertExprReturns(TestContext.java:760)
at mondrian.rolap.RolapConnectionTest.checkLocale(RolapConnectionTest.java:244)
at mondrian.rolap.RolapConnectionTest.testFormatLocale(RolapConnectionTest.java:205)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


I've also tried increasing hive.metastore.server.max.threads in the hive configurations but thats not helping.