[Mondrian] HiveDialect not being found

Julian Hyde jhyde at pentaho.com
Wed Jul 4 00:10:26 EDT 2012


On Jul 3, 2012, at 4:35 PM, Craig Soules wrote:

I'm sure someone has seen this before, so hopefully this will be easy to answer.

I think this is a new issue. (Some other problems are logged in http://jira.pentaho.com/browse/MONDRIAN-789.) But I'll give it my best shot...

I'm trying to hook up Mondrian to Hive.  I noticed that there is a HiveDialect implementation, but that it was not listed in the META-INF/services/mondrian.spi.Dialect file in the 3.4.1 release.  I've tried several methods for adding it (described below), but I keep feeling the following error:

Main error
mondrian.olap.MondrianException: Mondrian Error:Internal error: while quoting identifier
at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:942)
at mondrian.olap.Util.newInternal(Util.java:2261)
at mondrian.spi.impl.JdbcDialectImpl.deduceIdentifierQuoteString(JdbcDialectImpl.java:179)
at mondrian.spi.impl.JdbcDialectImpl.<init>(JdbcDialectImpl.java:113)
at mondrian.spi.DialectManager$DialectManagerImpl$1.createDialect(DialectManager.java:173)
at mondrian.spi.DialectManager$ChainDialectFactory.createDialect(DialectManager.java:278)
at mondrian.spi.DialectManager$CachingDialectFactory.createDialect(DialectManager.java:377)
at mondrian.spi.DialectManager$DialectManagerImpl.createDialect(DialectManager.java:237)
at mondrian.spi.DialectManager.createDialect(DialectManager.java:80)
at mondrian.test.loader.MondrianFoodMartLoader.load(MondrianFoodMartLoader.java:380)
at mondrian.test.loader.MondrianFoodMartLoader.main(MondrianFoodMartLoader.java:342)
Caused by: java.sql.SQLException: Method not supported
at org.apache.hadoop.hive.jdbc.HiveDatabaseMetaData.getIdentifierQuoteString(HiveDatabaseMetaData.java:356)
at mondrian.spi.impl.JdbcDialectImpl.deduceIdentifierQuoteString(JdbcDialectImpl.java:172)
... 8 more

I believe this indicates that the default JdbcDialectImpl is being used instead of the HiveDialect

You are correct. HiveDialect overrides deduceIdentifierQuoteString, but only the base method occurs in the stack.

... I can't seem to figure out why or how to fix it.  I tried unpacking mondian.jar, adding a line for the HiveDialect, and re-packing it.  I have also tried re-building Mondrian from scratch with that line added to the build's version of the file, also with no success.

You're trying to do the right thing. I don't know why adding a line to mondrian.spi.Dialect doesn't work.

Are you running under a web server such as tomcat? Sometimes web servers will unpack to their working directory and your modified version won't be seen.

I know that my JDBC parameters are correct, because I can see Mondrian connecting to Hive, but because Hive's JDBC driver is not full-featured (thus the need for the HiveDialect), I keep getting this failure.

Any pointers or help on this would be much appreciated!

Reading the code, there is probably a problem in JdbcDialectImpl.getProduct. It never returns DatabaseProduct.HIVE. Try adding an appropriate 'else if' clause.

I will add a line to mondrian.spi.Dialect. Even thought the Hive dialect is only beta quality, we might as well register it. I will also add a Dialect parameter to Mondrian's connect string; we might as well allow people to explicitly specify a dialect class, if they know what they want.

Hope this helps. Please let me know whether or not this solves your problem. I'd like to resolve this issue.

Julian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20120703/e2a7b127/attachment.html 


More information about the Mondrian mailing list