Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)
Super Guru

HDP 2.5 GA'd phoenix query server. This makes connecting to phoenix much easier. Article will walk through steps on how to connect to phoenix Phoenix Query Server via DBVisualizer.

Grab the phoenix thin jdbc driver onto your desktop. On the HDP 2.5 here is the location of the jdbc driver

8721-1a.jpg

Start up DBVisualizer. From the top menu bar select Tools->Driver Manager

8722-1.jpg

Popoluate the fields:

Name:Apache Phoenix Thin Client

I used phoenixthin.

URL Format: jdbc:phoenix:thin:url=<scheme>://<server-hostname>:<port>[...]

Client on the folder icon

8723-2.jpg

Locate your phoenix thin jdbc driver you downloaded to your desktop. Once selected click on ok and and now you have the driver loaded.

Lets connect to phoenix. Click on the icon shown below which creates a new db connection. Then select "Use Wizard".

8724-3.jpg

Enter a connection name. I used phoenix-QPS

8725-4.jpg

Now select the driver you loaded in the previous steps. I named my driver phoenixthin

8726-5.jpg

Next enter your userid & password. For this example I use the root user ID

8727-6.jpg

Now a data connection has been created. Lets connect to phoenix using that connection alias. Go to your connection alias shown on the left pane. Right click and select "Connect"

8728-7.jpg

You are now connected! Start having fun and open up some name spaces. Select * from tables

8729-8.jpg

It is clear connecting to Phoenix is much easier now thanks to the community building Phoenix Query Server. Happy Phoenix-ing

3,439 Views
Comments
Expert Contributor

@Sunile Manjee

Followed the above and getting:

An error occurred while establishing the connection: Long Message: Remote driver error: RuntimeException: java.sql.SQLFeatureNotSupportedException -> SQLFeatureNotSupportedException: (null exception message) Details: Type: org.apache.calcite.avatica.AvaticaClientRuntimeException Stack Trace: AvaticaClientRuntimeException: Remote driver error: RuntimeException: java.sql.SQLFeatureNotSupportedException -> SQLFeatureNotSupportedException: (null exception message). Error -1 (00000) null java.lang.RuntimeException: java.sql.SQLFeatureNotSupportedException at org.apache.calcite.avatica.jdbc.JdbcMeta.propagate(JdbcMeta.java:681) at org.apache.calcite.avatica.jdbc.JdbcMeta.connectionSync(JdbcMeta.java:671) at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:314) at org.apache.calcite.avatica.remote.Service$ConnectionSyncRequest.accept(Service.java:2001) at org.apache.calcite.avatica.remote.Service$ConnectionSyncRequest.accept(Service.java:1977) at org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:95) at org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:46) at org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:124) at org.apache.phoenix.shaded.org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.apache.phoenix.shaded.org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.apache.phoenix.shaded.org.eclipse.jetty.server.Server.handle(Server.java:499) at org.apache.phoenix.shaded.org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.apache.phoenix.shaded.org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.apache.phoenix.shaded.org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) at org.apache.phoenix.shaded.org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.apache.phoenix.shaded.org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLFeatureNotSupportedException at org.apache.phoenix.jdbc.PhoenixConnection.setCatalog(PhoenixConnection.java:799) at org.apache.calcite.avatica.jdbc.JdbcMeta.apply(JdbcMeta.java:652) at org.apache.calcite.avatica.jdbc.JdbcMeta.connectionSync(JdbcMeta.java:666) ... 15 more at org.apache.calcite.avatica.remote.Service$ErrorResponse.toException(Service.java:2453) at org.apache.calcite.avatica.remote.RemoteProtobufService._apply(RemoteProtobufService.java:61) at org.apache.calcite.avatica.remote.ProtobufService.apply(ProtobufService.java:89) at org.apache.calcite.avatica.remote.RemoteMeta$5.call(RemoteMeta.java:148) at org.apache.calcite.avatica.remote.RemoteMeta$5.call(RemoteMeta.java:134) at org.apache.calcite.avatica.AvaticaConnection.invokeWithRetries(AvaticaConnection.java:715) at org.apache.calcite.avatica.remote.RemoteMeta.connectionSync(RemoteMeta.java:133) at org.apache.calcite.avatica.AvaticaConnection.sync(AvaticaConnection.java:664) at org.apache.calcite.avatica.AvaticaConnection.getAutoCommit(AvaticaConnection.java:181) at com.onseven.dbvis.g.B.C.ā(Z:1315) at com.onseven.dbvis.g.B.F$A.call(Z:1369) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Through CLI, i am able to connect :

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #5330e1} span.s1 {font-variant-ligatures: no-common-ligatures}

[cloudbreak@ip-172-40-1-169 bin]$ ./sqlline-thin.py

Setting property: [incremental, false]

Setting property: [isolation, TRANSACTION_READ_COMMITTED]

issuing: !connect jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF none none org.apache.phoenix.queryserver.client.Driver

Connecting to jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF

Triple checked I am loading the correct driver. Anything else I could be missing?

Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
2 of 2
Last update:
‎08-17-2019 08:45 AM
Updated by:
 
Contributors
Top Kudoed Authors