下面是我在尝试使用 jdbc 连接连接 hive 时遇到的异常。
Connection con = DriverManager.getConnection("jdbc:hive://localhost:10000/default", "hive", "");
错误:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.thrift.protocol.TProtocol.getScheme()Ljava/lang/Class;
at org.apache.hadoop.hive.service.ThriftHive$execute_args.write(ThriftHive.java:1076)
at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63)
at org.apache.hadoop.hive.service.ThriftHive$Client.send_execute(ThriftHive.java:110)
at org.apache.hadoop.hive.service.ThriftHive$Client.execute(ThriftHive.java:102)
at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:187)
at org.apache.hadoop.hive.jdbc.HiveStatement.execute(HiveStatement.java:127)
at org.apache.hadoop.hive.jdbc.HiveConnection.configureConnection(HiveConnection.java:126)
at org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:121)
at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:104)
at java.sql.DriverManager.getConnection(DriverManager.java:620)
at java.sql.DriverManager.getConnection(DriverManager.java:200)
at HiveJdbcClient.main(HiveJdbcClient.java:24)
该类TProtocol.java in libthrift-0.9.0.jar
没有方法getScheme()
。
谁能告诉我我需要使用哪个 Jar 文件。
谢谢你。