I found so many webpages show me how to connect to phoenix.They all looks like the code down below,But that's not working.Do any one know how to do it? Please tell me.Thanks.
import jpype
import jaydebeapi
phoenix_client_jar = r"D:\Python\TestFile\lib\phoenix-5.0.0.3.1.0.0-78-client.jar"
args = '-Djava.class.path=%s' % phoenix_client_jar
jvm_path = jpype.getDefaultJVMPath()
jpype.startJVM(jvm_path, args)
conn = jaydebeapi.connect('org.apache.phoenix.jdbc.PhoenixDriver',
'jdbc:phoenix:wmshadooptest60,wmshadooptest58,wmshadooptest59:2181', ['', ''],
phoenix_client_jar)
print("test info....")
curs = conn.cursor()
sql = "select * from SYSTEM.CATALOG limit 1"
count = curs.execute(sql)
results = curs.fetchall()
for r in results:
print(r)
I only got this outcome:
C:\Python35\python.exe D:/Python/TestFile/phoenix_query.py
C:\Python35\lib\site-packages\jpype\_core.py:210: UserWarning:
-------------------------------------------------------------------------------
Deprecated: convertStrings was not specified when starting the JVM. The default
behavior in JPype will be False starting in JPype 0.8. The recommended setting
for new code is convertStrings=False. The legacy value of True was assumed for
this session. If you are a user of an application that reported this warning,
please file a ticket with the developer.
-------------------------------------------------------------------------------
""")
log4j:WARN No appenders could be found for logger (org.apache.hadoop.util.Shell).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
I found so many webpages show me how to connect to phoenix.They all looks like the code down below,But that's not working.Do any one know how to do it? Please tell me.Thanks.
I only got this outcome: