I am trying to connect to Phoenix queryserver from Spark. Following Scala
code works perfectly fine when i run it without spark.
*import java.sql.{Connection, DriverManager, PreparedStatement, ResultSet,
Statement}
Class.forName("org.apache.phoenix.queryserver.client.Driver")
val connection=
DriverManager.getConnection("jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF");
val statement = connection.createStatement()*
But the same code fails with following exception in Spark Shell / Spark
Submit -
/java.lang.RuntimeException: response code 500
at
org.apache.calcite.avatica.remote.RemoteService.apply(RemoteService.java:45)
at
org.apache.calcite.avatica.remote.JsonService.apply(JsonService.java:235)
at
org.apache.calcite.avatica.remote.RemoteMeta.connectionSync(RemoteMeta.java:97)
at
org.apache.calcite.avatica.remote.RemoteMeta.createStatement(RemoteMeta.java:65)
at
org.apache.calcite.avatica.AvaticaStatement.<init>(AvaticaStatement.java:83)
at
org.apache.calcite.avatica.AvaticaJdbc41Factory$AvaticaJdbc41Statement.<init>(AvaticaJdbc41Factory.java:114)
at
org.apache.calcite.avatica.AvaticaJdbc41Factory.newStatement(AvaticaJdbc41Factory.java:73)
at
org.apache.calcite.avatica.AvaticaConnection.createStatement(AvaticaConnection.java:263)
at
org.apache.calcite.avatica.AvaticaConnection.createStatement(AvaticaConnection.java:110)
at
org.apache.calcite.avatica.AvaticaConnection.createStatement(AvaticaConnection.java:51)
... 48 elided/
I am using Spark 2.1.0 along with Phoenix 4.11 with HBase 1.3.
I could not find any similar error on the internet. Please help.
--
Sent from: http://apache-phoenix-user-list.1124778.n5.nabble.com/