It’s been a while, but I’ve connected to Phoenix using NiFi. It looks like the 
jdbc jar your using on the NiFi side is newer than what you have deployed to 
your Cloudera Environment. Are you using 
phoenix-client-hbase-2.2-5.1.0.7.1.6.0-297.jar in NiFi? There used to be 
additional jars that had to be in the same folder too, not sure if that’s the 
case now.

Thanks
Shawn

From: ajaz rahman <[email protected]>
Sent: Wednesday, February 9, 2022 5:01 AM
To: [email protected]
Subject: Using Jdbc Driver to connect with phoenix

Hi,

I am using jdbc driver to connect with CDP Phoenix from nifi.

I am able to connect with CDP Phoenix using my spark code.

from pyspark.sql import SparkSession
spark2 = 
SparkSession.builder.appName("sparkanalysis").config("spark.driver.extraClassPath","/opt/cloudera/parcels/CDH-7.1.6-1.cdh7.1.6.p0.10506313/lib/phoenix_queryserver/phoenix-client-hbase-2.2-5.1.0.7.1.6.0-297.jar").getOrCreate()

pgDF = spark2.read \
.format("jdbc") \
.option("url", "jdbc:phoenix:10.64.63.122:2181:/hbase") \
.option("dbtable", "mydata_table") \
.option("user", "") \
.option("password", "") \
.load()

pdDF.printSchema()


When trying to connect from nifi using same driver. I get error, snapshot is 
attached along this mail.  Its a very simple nifi flow with just one task 
running an SQL.
Connection properties attached as snapshot.

I have been trying crack this for a couple of days without success. Any help 
around this will receive a lot of love.


Regards,
Ajaz-Ur-Rahman

Reply via email to