- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Phoenixdb FetchAll not working
- Labels:
-
Apache Phoenix
Created ‎09-26-2016 06:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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()
Created ‎09-26-2016 06:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎09-26-2016 06:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
