phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Terrell <sterr...@oculus360.us>
Subject Re: Phoenix Query Server Avatica Upsert
Date Fri, 05 Feb 2016 19:46:06 GMT
I'm using HBase 0.98.15, so I installed
https://dist.apache.org/repos/dist/dev/phoenix/phoenix-4.7.0-HBase-0.98-rc1/

Had a problem starting the query server that I resolved by
deleting $PHOENIX_OPTS from queryserver.py .  (It was giving me "Error:
Could not find or load main class $PHOENIX_OPTS")

When I tried to send a "createStatement" via curl and via Lukas's
phoenixdb, I got these error's respectively:

<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /. Reason:
<pre>    Cannot find parser for </pre></p>


  File "/usr/local/lib/python2.7/site-packages/phoenixdb/avatica.py", line
100, in parse_error_page
    raise errors.InternalError(message)
phoenixdb.errors.InternalError: ('Cannot find parser for', None, None, None)


Too bad - I think I need 4.7 to pass JSON in the HTTP request body.

However, I *was* able to get phoenixdb working with my Phoenix 4.6, both
selects and upserts, both locally and remotely.  So, I'd like to take
Lukas's advice and log what is being sent so I can replicate it outside of
Python.

Does anyone know:

   - How to log the headers and body of all requests
   - Where the Avatica documentation is for how to make queries for
   different versions?  As I linked in my original email, all I could find was
   syntax of the latest JSON, bit no docs on headers, post body, how to form
   the HTTP request, etc.

Thanks again,
    Steve

On Fri, Feb 5, 2016 at 11:29 AM, James Taylor <jamestaylor@apache.org>
wrote:

> But please feel free to play around with the last RC:
> http://mail-archives.apache.org/mod_mbox/phoenix-dev/201601.mbox/%3CCAAF1JdgFzrwWBBcs586hkJnoZaZFBYDGxtaqUZjAuQM1XwBgOQ%40mail.gmail.com%3E
>
> On Fri, Feb 5, 2016 at 9:26 AM, James Taylor <jamestaylor@apache.org>
> wrote:
>
>> Phoenix 4.7.0 is not released yet. A couple of issues can up in the last
>> RC, so we'll roll a new one very soon.
>>
>> Thanks,
>> James
>>
>> On Fri, Feb 5, 2016 at 9:23 AM, Steve Terrell <sterrell@oculus360.us>
>> wrote:
>>
>>> Oh, I didn't know there was a 4.7.  Following the links on
>>> https://phoenix.apache.org/download.html only takes me to locations
>>> that have 4.6 available to download, which is the version I am using.
>>>
>>> Looking at my 4.6 pom.xml it appears to be build
>>> with <calcite.version>1.3.0-incubating</calcite.version> , which
>>> incidentally may answer my other related/similar question in my other
>>> email:  How to send the query on the body.  I now see form your source code
>>> that this is only supported for "if self.version >= AVATICA_1_4_0:"
>>>
>>> So I will hunt for Phoenix 4.7 to see if it can solved both my issues.
>>> Thank you, Lukas.
>>>
>>> By the way, in case this helps anyone else, I found these two links:
>>>
>>>    - http://hortonworks.com/search-results/?search=phoenix+query+server
>>>    -
>>>    https://community.hortonworks.com/questions/1985/phoenix-query-server-upsert-fail.html
>>>
>>> Thanks,
>>>     Steve
>>>
>>> On Fri, Feb 5, 2016 at 10:41 AM, Lukáš Lalinský <lalinsky@gmail.com>
>>> wrote:
>>>
>>>> This depends on the exact version of Avatica you are using, because
>>>> it's different in all released versions.
>>>>
>>>> In this comment you can see an example of running UPSERT with 1.4 with
>>>> the JSON serializer (I think Phoenix 4.7 includes that version):
>>>>
>>>>
>>>> https://issues.apache.org/jira/browse/CALCITE-1050?focusedCommentId=15093324&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15093324
>>>>
>>>> You can also try my Python module for talking to the server. With
>>>> verbose logging, it will print the exact JSON documents it's sending.
>>>>
>>>> https://code.oxygene.sk/lukas/python-phoenixdb
>>>>
>>>> Lukas
>>>>
>>>>
>>>> On Fri, Feb 5, 2016 at 5:16 PM, Steve Terrell <sterrell@oculus360.us>
>>>> wrote:
>>>>
>>>>> Does anyone have an example of how to upsert a row in a Phoenix table
>>>>> via the Avatica HTTP mechanism?
>>>>>
>>>>> The closest thing to documentation I can find are these two links:
>>>>>
>>>>>    -
>>>>>    https://community.hortonworks.com/questions/1565/phoenix-query-server-documentation.html
>>>>>    - https://calcite.apache.org/docs/avatica_json_reference.html
>>>>>
>>>>> I got the select example working, but cannot get an upsert to work.
>>>>>
>>>>> Thanks,
>>>>>     Steve
>>>>>
>>>>
>>>>
>>>
>>
>

Mime
View raw message