简体   繁体   English

java.sql.SQLException:不支持将 HikariCP 与 Hive JDBC 结合使用的方法

[英]java.sql.SQLException: Method not supported on using HikariCP with Hive JDBC

I am using MySQL as meta store for hive.我使用 MySQL 作为 hive 的元存储。

In my JDBC code, I replaced在我的 JDBC 代码中,我替换了

DriverManager.getConnection(connectionUri, username, password);

to

 HikariDataSource ds = new HikariDataSource();
 ds.setJdbcUrl(connectionUri);
 ds.setUsername(username);
 ds.setPassword(password); 
 return ds.getConnection();

I got following exception:我得到以下异常:

com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Method not supported
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:514)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:107)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:94)
at com.impetus.idw.data.connector.utils.JDBCUtil.getJdbcConnection(JDBCUtil.java:173)
at com.impetus.idw.data.connector.utils.JDBCUtil.checkTableExistence(JDBCUtil.java:66)
at com.impetus.idw.data.connector.datasource.HiveTable.exists(HiveTable.java:146)
at com.impetus.idw.data.connector.tools.hive.HiveToHiveCopyBaseTest.testMetadata(HiveToHiveCopyBaseTest.java:25)
at com.impetus.idw.data.connector.tools.hive.LocalToLocalTest.testHive(LocalToLocalTest.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.sql.SQLException: Method not supported
at org.apache.hive.jdbc.HiveConnection.setReadOnly(HiveConnection.java:1271)
at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:372)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:346)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:508)
... 31 more

Does HikariCP supports Hive JDBC? HikariCP 是否支持 Hive JDBC?

Is there any way to avoid call to org.apache.hive.jdbc.HiveConnection.setReadOnly method?有没有办法避免调用org.apache.hive.jdbc.HiveConnection.setReadOnly方法?

Use latest (> 2.0.0) hive driver.使用最新的 (> 2.0.0) hive 驱动程序。 See issue resolved in hive.请参阅在 hive 中解决的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.sql.SQLException:使用HSQL和Spring不支持此功能 - java.sql.SQLException: This function is not supported using HSQL and Spring java.sql.SQLException: 使用 jsp 连接时找不到适合 jdbc:hive2://localhost:10000/default 的驱动程序 - java.sql.SQLException: No suitable driver found for jdbc:hive2://localhost:10000/default while connecting using jsp java.sql.SQLException:找不到-JDBC - java.sql.SQLException: not found - JDBC java.sql.SQLException:没有为jdbc找到合适的驱动程序:hive:// localhost:10000 / default - java.sql.SQLException: No suitable driver found for jdbc:hive://localhost:10000/default java JDBC:引起:java.sql.SQLException:数字溢出 - java JDBC : Caused by: java.sql.SQLException: Numeric Overflow JDBC SQL Server错误:java.sql.SQLException:没有合适的驱动程序 - jdbc sql server error: java.sql.SQLException: No suitable driver java.sql.SQLException(使用密码:NO) - java.sql.SQLException (using password: NO) java.sql.SQLException:找不到适合jdbc:oracle:thin的驱动程序 - java.sql.SQLException: No suitable driver found for jdbc:oracle:thin java.sql.SQLException:找不到适用于jdbc:derby的驱动程序: - java.sql.SQLException: No suitable driver found for jdbc:derby: java.sql.SQLException:找不到适用于jdbc:mysql的驱动程序 - java.sql.SQLException: No suitable driver found for jdbc:mysql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM