Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-6759

Phoenix driver cannot be loaded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • connectors-6.0.0
    • None
    • hive-connector
    • 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);
      } 

       

      Attachments

        1. Phoenix-6759.V1.patch
          1 kB
          selina.yan

        Activity

          People

            Unassigned Unassigned
            selina.yan selina.yan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: