lalinsky / python-phoenixdb

Phoenix database adapter for Python (migrated to the Apache Phoenix repo)
https://issues.apache.org/jira/browse/PHOENIX-4636
Apache License 2.0
26 stars 24 forks source link

Add array support #3

Open sylphy-zh opened 7 years ago

sylphy-zh commented 7 years ago

If I create table 'USER', and it's schema defined 'PERSONA'.

database_url = "http://master:8765/"
conn = phoenixdb.connect(database_url, autocommit=True)
cursor = conn.cursor()
cursor.execute("SELECT * FROM USER")

It has a error: Table undefined , tableName='USER'. But When I use below query:

SELECT * FROM PERSON.USER

this will have a ERROR: UnsupportedOperationException: Currently not supported.

When I see the source code and not found anywhere I can specify the schema parameter.

How to solve this? Any idea?

lalinsky commented 7 years ago

How did you get the query server running with schema support? I'm trying to do it myself, but I'm failing on this:

Inconsistent namespace mapping properites.. Ensure that config phoenix.schema.isNamespaceMappingEnabled is consitent on client and server.

Can you please share how are you running the query server?

lalinsky commented 7 years ago

I have added a test to check that schema support works:

https://github.com/lalinsky/python-phoenixdb/commit/424a3751d25a1073a4dedcf454ab044d9f900aa1

I'm unable to reproduce your problem. Can you please describe how are you running HBase/Phoenix?

sylphy-zh commented 7 years ago

@lalinsky Thanks for your response. When I see some doc found that the phoenixdb is still not support array type field. Because there have some array type fields in my table, and query the non-array fields is ok. But when I use /path/to/phoenix/sqlline.py, same query is work fine.

Env : phoenixdb => 0.7

phoenixdb use protocol buffer transport default, I don't know whether json is support to use array type fields. Docs seems still not suport now.

lalinsky commented 7 years ago

Array support is not implemented yet. It has been added to Avatica/Phoenix since I started working in this project, but the type encoding/decoding code still needs to be updated.