import jaydebeapi
import pandas as pd
import pandas.io.sql as psql
driver = 'org.apache.phoenix.jdbc.PhoenixDriver'
url = 'jdbc:phoenix:node1:2181:default'
arFile = r'/opt/cloudera/parcels/PHOENIX/lib/phoenix/phoenix-5.0.0-cdh6.2.0-client.jar'
conn = jaydebeapi.connect(driver, [url, '',''], jarFile)
curs = conn.cursor()
curs.execute('select * from users')
rows = curs.fetchall()
print(rows[0])
query = "select * from users"
df = psql.read_sql_query(query, conn) #pd.read_sql_query(sqlalchemy.text(sql), con=conn)
print(df)
curs.close()
conn.close()