Re: apache phoenix json api

2016-04-21 Thread Plamen Paskov
Hi Francis, Thank you for supporting me ! I appreciate that! Below are the commands i executed and the respective responses. As you will see the new data is missing. And these are the details about my setup: OS: Ubuntu 14.04.3 LTS hbase: Version 1.1.2.2.3.4.0-3485 phoenix: Version

Re: apache phoenix json api

2016-04-20 Thread F21
Hey Plamen, I just spun up some clean docker containers running Hbase 1.1.4 and Phoenix 4.7.0 to replicate what you did. It appears to work correctly. Using SquirrelSQL, I created the table: CREATE TABLE IF NOT EXISTS us_population (state CHAR(2) NOT NULL, city VARCHAR NOT NULL, population

Re: apache phoenix json api

2016-04-20 Thread Plamen Paskov
Josh, I hope someone familiar can answer this question :) On 19.04.2016 22:59, Josh Elser wrote: Thanks for helping out, Francis! Interesting that Jackson didn't fail when the connectionId was being passed as a number and not a string (maybe it's smart enough to convert that?). Why does

Re: apache phoenix json api

2016-04-19 Thread Josh Elser
Thanks for helping out, Francis! Interesting that Jackson didn't fail when the connectionId was being passed as a number and not a string (maybe it's smart enough to convert that?). Why does your commit response have a result set in it? A CommitResponse is essentially empty.

Re: apache phoenix json api

2016-04-19 Thread Josh Elser
Nope, you shouldn't need to do this. "statements" that you create using the CreateStatementRequest are very similarly treated to the JDBC Statement interface (they essentially refer to an instance of a PhoenixStatement inside PQS, actually). You should be able to create one statement and

Re: apache phoenix json api

2016-04-19 Thread Plamen Paskov
i confirm that the data is missing when connecting using sqlline.py command line client. If i upsert a record from within sqlline.py it's ok. I will give a try to what you suggest to issue prepare and execute as separate requests. thanks ! On 19.04.2016 14:24, F21 wrote: Can you try using

Re: apache phoenix json api

2016-04-19 Thread F21
Can you try using something like SquirrelSQL or sqlline to see if the data was inserted properly? Another thing I would try is to use separate prepare and execute requests when SELECTing rather than using prepareAndExecute. On 19/04/2016 9:21 PM, Plamen Paskov wrote: Yep Here are the

Re: apache phoenix json api

2016-04-19 Thread Plamen Paskov
Yep Here are the responses (the new data is missing again): Prepare and execute response for upsert { "response": "executeResults", "missingStatement": false, "rpcMetadata": { "response": "rpcMetadata", "serverAddress": "ip-172-31-27-198:8765" }, "results": [ {

Re: apache phoenix json api

2016-04-19 Thread F21
The connectionId for all requests should be a string. Can you try that? On 19/04/2016 5:07 PM, Plamen Paskov wrote: That's what i tried but with no luck again: { "request": "openConnection", "connectionId": 8 } { "request": "createStatement", "connectionId": 8 } { "request":

Re: apache phoenix json api

2016-04-19 Thread Plamen Paskov
That's what i tried but with no luck again: { "request": "openConnection", "connectionId": 8 } { "request": "createStatement", "connectionId": 8 } { "request": "prepareAndExecute", "connectionId": 8, "statementId": 18, "sql": "UPSERT INTO us_population

Re: apache phoenix json api

2016-04-19 Thread F21
Can you show the requests you are currently sending? This is what a PrepareAndExecute request should look like: https://calcite.apache.org/docs/avatica_json_reference.html#prepareandexecuterequest On 19/04/2016 4:47 PM, Plamen Paskov wrote: Josh, I removed the quotation but the result is still

Re: apache phoenix json api

2016-04-17 Thread Josh Elser
Also, you're using the wrong command. You want "prepareAndExecute" not "prepareAndExecuteBatch". Josh Elser wrote: Thanks, will fix this. Plamen Paskov wrote: Ah i found the error. It should be "sqlCommands": instead of "sqlCommands", The documentation syntax is wrong for this request type:

Re: apache phoenix json api

2016-04-17 Thread Josh Elser
statementId is an integer, not a string. Remove the quotation marks around the value "2". Plamen Paskov wrote: Now another error appears for prepare and execute batch request: Error 500 HTTP ERROR: 500 Problem accessing /. Reason:

Re: apache phoenix json api

2016-04-17 Thread Josh Elser
Thanks, will fix this. Plamen Paskov wrote: Ah i found the error. It should be "sqlCommands": instead of "sqlCommands", The documentation syntax is wrong for this request type: http://calcite.apache.org/avatica/docs/json_reference.html#prepareandexecutebatchrequest On 14.04.2016 11:09, Plamen

Re: apache phoenix json api

2016-04-14 Thread Plamen Paskov
Now another error appears for prepare and execute batch request: content="text/html;charset=ISO-8859-1"/> Error 500 HTTP ERROR: 500 Problem accessing /. Reason: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:

Re: apache phoenix json api

2016-04-14 Thread Plamen Paskov
Ah i found the error. It should be "sqlCommands": instead of "sqlCommands", The documentation syntax is wrong for this request type: http://calcite.apache.org/avatica/docs/json_reference.html#prepareandexecutebatchrequest On 14.04.2016 11:09, Plamen Paskov wrote: @Josh: thanks for your answer.

Re: apache phoenix json api

2016-04-14 Thread Plamen Paskov
@Josh: thanks for your answer. Folks, I'm trying to prepare and execute batch request with no luck. These are the requests i send: { "request": "openConnection", "connectionId": "2" } { "request": "createStatement", "connectionId": "2" } { "request": "prepareAndExecuteBatch",

Re: apache phoenix json api

2016-04-13 Thread Josh Elser
For reference materials: definitely check out https://calcite.apache.org/avatica/ While JSON is easy to get started with, there are zero guarantees on compatibility between versions. If you use protobuf, we should be able to hide all schema drift from you as a client (e.g. applications you

Re: apache phoenix json api

2016-04-13 Thread F21
I am currently building a golang client as well, so I've been looking the api over the last few weeks. I am not sure about the decision to have to create a statement first, but in terms of go, it fits the sql package very well, where statements are opened and closed. I don't think there are

Re: apache phoenix json api

2016-04-13 Thread F21
Your PrepareAndExecute request is missing a statementId: https://calcite.apache.org/docs/avatica_json_reference.html#prepareandexecuterequest Before calling PrepareAndExecute, you need to send a CreateStatement request to the server so that it can give you a statementId. Then, use that

apache phoenix json api

2016-04-13 Thread Plamen Paskov
Hi guys, I just setup apache phoenix 4.7 and set the serialization to JSON. Now i'm trying to run a select statement but what i receive is this: { "response": "executeResults", "missingStatement": true, "rpcMetadata": { "response": "rpcMetadata", "serverAddress":