Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

Phoenixdb FetchAll not working

New Contributor

The queries like upsert are working fine and data is getting inserted into tables but when I execute a select query and print result, it shows empty.

The output which I am getting for this is [ ].

I have checked with sqlline.py and have seen that the table has 2 rows.

import phoenixdb
database_url = 'http://localhost:8765/?v=1.6'
conn = phoenixdb.connect(database_url, autocommit=True)
cursor = conn.cursor()
cursor.execute("upsert into users values(2,'user')")
cursor.execute("select * from users")
print cursor.fetchall()
1 ACCEPTED SOLUTION

Super Guru

I think the issue is using the same cursor or it's because of you using the wrong version of Phoenix/Phoenix connection.

Remember you also need to be using an older version as the newest version of Phoenix uses Google Protocol Buffers for data retrieval and PhoenixDB only does the older jSON.

See: https://bitbucket.org/lalinsky/python-phoenixdb

Is your server running Phoenix 4.7, then it is v=1.6, but that is Protocol Buffers. Python does not support this. You can restart your phoenix query server with the phoenix.queryserver.serialization parameter set to JSON.

Hopefully Python-PhoenixDB will be updated to use the current protocol.

View solution in original post

1 REPLY 1

Super Guru

I think the issue is using the same cursor or it's because of you using the wrong version of Phoenix/Phoenix connection.

Remember you also need to be using an older version as the newest version of Phoenix uses Google Protocol Buffers for data retrieval and PhoenixDB only does the older jSON.

See: https://bitbucket.org/lalinsky/python-phoenixdb

Is your server running Phoenix 4.7, then it is v=1.6, but that is Protocol Buffers. Python does not support this. You can restart your phoenix query server with the phoenix.queryserver.serialization parameter set to JSON.

Hopefully Python-PhoenixDB will be updated to use the current protocol.