Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
connectors-6.0.0
-
None
-
None
Description
When I query the association table of hive Association Phoenix, I cannot load the driver.and the error is as follows:
Caused by: java.sql.SQLException: No suitable driver found for jdbc:phoenix:host01:2181:/hbase;
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.apache.phoenix.hive.util.PhoenixConnectionUtil.getConnection(PhoenixConnectionUtil.java:99)
at org.apache.phoenix.hive.util.PhoenixConnectionUtil.getInputConnection(PhoenixConnectionUtil.java:62)
at org.apache.phoenix.hive.PhoenixSerializer.<init>(PhoenixSerializer.java:72)
... 40 more (state=42000,code=40000)
The usage scenario is add phoenix-version-hive.jar by adding jar.By viewing the code,the reason for the failure is that the getConnection method of the query cannot support dynamic addition of drivers.
private static Connection getConnection(final String quorum, final Integer clientPort, String zNodeParent, Properties props) throws SQLException { if (LOG.isDebugEnabled()) { LOG.debug("Connection attrs [quorum, port, znode] : " + quorum + ", " + clientPort + ", " + zNodeParent); } return DriverManager.getConnection(clientPort != null ? QueryUtil.getUrl(quorum, clientPort, zNodeParent) : QueryUtil.getUrl(quorum), props); }