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

python-phoenixdb version for phoenix4.13 #6

Open krjwpark opened 6 years ago

krjwpark commented 6 years ago

Hello, I`m trying to get connect to phoenix server, phoenix version is 4.13(And spark(2.3.0,+pyspark) Hbase(1.2) are used, python version is 2.7.5). With the newest version(v.0.7) for python-phoenixdb, and I got "RPC request failed" error(However, server is working).

According to changelog, v.0.7 covers phoenix 4.8 to 4.11, but I`m wondering there is any compatibility solution for phoenix 4.13.

Thanks,

Follow are my code and entire error message.

import phoenixdb
import phoenixdb.cursor

database_url = 'http://localhost:12345/xxxx'
conn = phoenixdb.connect(database_url, autocommit=True)
---------------------------------------------------------------------------
InterfaceError                            Traceback (most recent call last)
<ipython-input-1-abddd0c12576> in <module>()
      3 
      4 database_url = 'http://localhost:12345:/xxxx'
----> 5 conn = phoenixdb.connect(database_url, autocommit=True)

/usr/lib/python2.7/site-packages/phoenixdb/__init__.pyc in connect(url, max_retries, **kwargs)
     65     client = AvaticaClient(url, max_retries=max_retries)
     66     client.connect()
---> 67     return Connection(client, **kwargs)

/usr/lib/python2.7/site-packages/phoenixdb/connection.pyc in __init__(self, client, cursor_factory, **kwargs)
     54             else:
     55                 self._filtered_args[k] = kwargs[k]
---> 56         self.open()
     57         self.set_session(**self._filtered_args)
     58 

/usr/lib/python2.7/site-packages/phoenixdb/connection.pyc in open(self)
     71         """Opens the connection."""
     72         self._id = str(uuid.uuid4())
---> 73         self._client.open_connection(self._id, info=self._connection_args)
     74 
     75     def close(self):

/usr/lib/python2.7/site-packages/phoenixdb/avatica.pyc in open_connection(self, connection_id, info)
    327                 request.info[k] = v
    328 
--> 329         response_data = self._apply(request)
    330         response = responses_pb2.OpenConnectionResponse()
    331         response.ParseFromString(response_data)

/usr/lib/python2.7/site-packages/phoenixdb/avatica.pyc in _apply(self, request_data, expected_response_type)
    205         headers = {'content-type': 'application/x-google-protobuf'}
    206 
--> 207         response = self._post_request(body, headers)
    208         response_body = response.read()
    209 

/usr/lib/python2.7/site-packages/phoenixdb/avatica.pyc in _post_request(self, body, headers)
    184                     retry_count -= 1
    185                     continue
--> 186                 raise errors.InterfaceError('RPC request failed', cause=e)
    187             else:
    188                 if response.status == httplib.SERVICE_UNAVAILABLE:

InterfaceError: ('RPC request failed', None, None, BadStatusLine("''",))
nciefeiniu commented 4 years ago

My current version of Phoenix is 4.14,resulting in some errors