<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Phoenix Query Server - upsert fail in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-Query-Server-upsert-fail/m-p/95898#M9295</link>
    <description>&lt;P&gt;This is what the JSON looks like when I'm running the query locally with sqlline. It also is a bleeding-edge build of Calcite, so there are some differences over what is in HDP2.3 presently (e.g. executeResults instead of Service$ExecuteResponse). The whole difference I see is that you were missing statementId in the prepareAndExecute request for the upsert.&lt;/P&gt;&lt;P&gt;The create table:&lt;/P&gt;&lt;PRE&gt;$ curl -XPOST -H 'request: {"request":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532"}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":22}

$ curl -XPOST -H 'request: {"request":"prepareAndExecute","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":22,"sql":"CREATE TABLE teste(id bigint not null, text varchar, constraint pk primary key (id))","maxRowCount":-1}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"executeResults","results":[{"response":"resultSet","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":22,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":0}]}
&lt;/PRE&gt;&lt;P&gt;The upsert:&lt;/P&gt;&lt;PRE&gt;$ curl -XPOST -H 'request: {"request":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532"}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":23}

$ curl -XPOST -H 'request: {"request":"prepareAndExecute","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":23,"sql":"upsert into teste (id) values (10)","maxRowCount":-1}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"executeResults","results":[{"response":"resultSet","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":23,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}]}
&lt;/PRE&gt;&lt;P&gt;The select&lt;/P&gt;&lt;PRE&gt;$ curl -XPOST -H 'request: {"request":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532"}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt; 
{"response":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":24}

$ curl -XPOST -H 'request: {"request":"prepareAndExecute","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":24,"sql":"select * from teste","maxRowCount":-1}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"executeResults","results":[{"response":"resultSet","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":24,"ownStatement":true,"signature":{"columns":[{"ordinal":0,"autoIncrement":false,"caseSensitive":false,"searchable":true,"currency":false,"nullable":0,"signed":true,"displaySize":40,"label":"ID","columnName":"ID","schemaName":"","precision":0,"scale":0,"tableName":"TESTE","catalogName":"","type":{"type":"scalar","id":-5,"name":"BIGINT","rep":"PRIMITIVE_LONG"},"readOnly":true,"writable":false,"definitelyWritable":false,"columnClassName":"java.lang.Long"},{"ordinal":1,"autoIncrement":false,"caseSensitive":false,"searchable":true,"currency":false,"nullable":1,"signed":false,"displaySize":40,"label":"TEXT","columnName":"TEXT","schemaName":"","precision":0,"scale":0,"tableName":"TESTE","catalogName":"","type":{"type":"scalar","id":12,"name":"VARCHAR","rep":"STRING"},"readOnly":true,"writable":false,"definitelyWritable":false,"columnClassName":"java.lang.String"}],"sql":null,"parameters":[],"cursorFactory":{"style":"LIST","clazz":null,"fieldNames":null},"statementType":null},"firstFrame":{"offset":0,"done":true,"rows":[]},"updateCount":-1}]}
&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Oct 2015 22:57:07 GMT</pubDate>
    <dc:creator>elserj</dc:creator>
    <dc:date>2015-10-23T22:57:07Z</dc:date>
    <item>
      <title>Phoenix Query Server - upsert fail</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-Query-Server-upsert-fail/m-p/95897#M9294</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm testing phoenix query server, working with a prospect that wants to use phoenix + .NET. &lt;/P&gt;&lt;P&gt;I'm not being able to succeed with upsert thru phoenix query server. curl response seems to be ok, but new data WAS NOT COMMITTED. It might be related to those two jiras:&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/PHOENIX-2320"&gt;https://issues.apache.org/jira/browse/PHOENIX-2320&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/PHOENIX-234"&gt;https://issues.apache.org/jira/browse/PHOENIX-234&lt;/A&gt;&lt;/P&gt;&lt;P&gt;my create table is:&lt;/P&gt;&lt;PRE&gt;create table teste(
  id bigint not null,
  text varchar 
  constraint pk primary key (id)
) ;
&lt;/PRE&gt;&lt;P&gt;Here is a select statement that works thru phoenix query server:&lt;/P&gt;&lt;PRE&gt;[root@hdp23 ~]# curl -XPOST -H 'request: {"request":"prepareAndExecute","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","sql":"select * from teste","maxRowCount":-1}' &lt;A href="http://localhost:8765/" target="_blank"&gt;http://localhost:8765/&lt;/A&gt;
{"response":"Service$ExecuteResponse","results":[{"response":"resultSet","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","statementId":1955331455,"ownStatement":true,"signature":{"columns":[{"ordinal":0,"autoIncrement":false,"caseSensitive":false,"searchable":true,"currency":false,"nullable":0,"signed":true,"displaySize":40,"label":"ID","columnName":"ID","schemaName":"","precision":0,"scale":0,"tableName":"TESTE","catalogName":"","type":{"type":"scalar","id":-5,"name":"BIGINT","rep":"PRIMITIVE_LONG"},"readOnly":true,"writable":false,"definitelyWritable":false,"columnClassName":"java.lang.Long"},{"ordinal":1,"autoIncrement":false,"caseSensitive":false,"searchable":true,"currency":false,"nullable":1,"signed":false,"displaySize":40,"label":"TEXT","columnName":"TEXT","schemaName":"","precision":0,"scale":0,"tableName":"TESTE","catalogName":"","type":{"type":"scalar","id":12,"name":"VARCHAR","rep":"STRING"},"readOnly":true,"writable":false,"definitelyWritable":false,"columnClassName":"java.lang.String"}],"sql":null,"parameters":[],"cursorFactory":{"style":"LIST","clazz":null,"fieldNames":null}},"firstFrame":{"offset":0,"done":true,"rows":[[1,"guilherme"],[2,"isabela"],[3,"rogerio"],[4,null]]},"updateCount":-1}]}
&lt;/PRE&gt;&lt;P&gt;And here insert statement, it says it worked, "updateCount=1"&lt;/P&gt;&lt;PRE&gt;[root@hdp23 log]# curl -XPOST -H 'request: {"request":"prepareAndExecute","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","sql":"upsert into teste (id) values (10)","maxRowCount":-1}' &lt;A href="http://localhost:8765/" target="_blank"&gt;http://localhost:8765/&lt;/A&gt;
{"response":"Service$ExecuteResponse","results":[{"response":"resultSet","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","statementId":1069768164,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}]}
&lt;/PRE&gt;&lt;P&gt;If I select table "teste" the new line is not there. I was not committed to phoenix table.&lt;/P&gt;&lt;P&gt;Additionally, /var/log/hbase/phoenix-hbase-server.log does show any message after command above.&lt;/P&gt;&lt;P&gt;Anyone has any idea what is going on and/or how to debug?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Guilherme&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 21:25:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-Query-Server-upsert-fail/m-p/95897#M9294</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2015-10-23T21:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Phoenix Query Server - upsert fail</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-Query-Server-upsert-fail/m-p/95898#M9295</link>
      <description>&lt;P&gt;This is what the JSON looks like when I'm running the query locally with sqlline. It also is a bleeding-edge build of Calcite, so there are some differences over what is in HDP2.3 presently (e.g. executeResults instead of Service$ExecuteResponse). The whole difference I see is that you were missing statementId in the prepareAndExecute request for the upsert.&lt;/P&gt;&lt;P&gt;The create table:&lt;/P&gt;&lt;PRE&gt;$ curl -XPOST -H 'request: {"request":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532"}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":22}

$ curl -XPOST -H 'request: {"request":"prepareAndExecute","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":22,"sql":"CREATE TABLE teste(id bigint not null, text varchar, constraint pk primary key (id))","maxRowCount":-1}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"executeResults","results":[{"response":"resultSet","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":22,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":0}]}
&lt;/PRE&gt;&lt;P&gt;The upsert:&lt;/P&gt;&lt;PRE&gt;$ curl -XPOST -H 'request: {"request":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532"}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":23}

$ curl -XPOST -H 'request: {"request":"prepareAndExecute","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":23,"sql":"upsert into teste (id) values (10)","maxRowCount":-1}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"executeResults","results":[{"response":"resultSet","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":23,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}]}
&lt;/PRE&gt;&lt;P&gt;The select&lt;/P&gt;&lt;PRE&gt;$ curl -XPOST -H 'request: {"request":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532"}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt; 
{"response":"createStatement","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":24}

$ curl -XPOST -H 'request: {"request":"prepareAndExecute","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":24,"sql":"select * from teste","maxRowCount":-1}' &lt;A href="http://localhost:8765" target="_blank"&gt;http://localhost:8765&lt;/A&gt;
{"response":"executeResults","results":[{"response":"resultSet","connectionId":"b27cbc83-a514-49f0-9bbe-f15d8bfb3532","statementId":24,"ownStatement":true,"signature":{"columns":[{"ordinal":0,"autoIncrement":false,"caseSensitive":false,"searchable":true,"currency":false,"nullable":0,"signed":true,"displaySize":40,"label":"ID","columnName":"ID","schemaName":"","precision":0,"scale":0,"tableName":"TESTE","catalogName":"","type":{"type":"scalar","id":-5,"name":"BIGINT","rep":"PRIMITIVE_LONG"},"readOnly":true,"writable":false,"definitelyWritable":false,"columnClassName":"java.lang.Long"},{"ordinal":1,"autoIncrement":false,"caseSensitive":false,"searchable":true,"currency":false,"nullable":1,"signed":false,"displaySize":40,"label":"TEXT","columnName":"TEXT","schemaName":"","precision":0,"scale":0,"tableName":"TESTE","catalogName":"","type":{"type":"scalar","id":12,"name":"VARCHAR","rep":"STRING"},"readOnly":true,"writable":false,"definitelyWritable":false,"columnClassName":"java.lang.String"}],"sql":null,"parameters":[],"cursorFactory":{"style":"LIST","clazz":null,"fieldNames":null},"statementType":null},"firstFrame":{"offset":0,"done":true,"rows":[]},"updateCount":-1}]}
&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Oct 2015 22:57:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-Query-Server-upsert-fail/m-p/95898#M9295</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2015-10-23T22:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Phoenix Query Server - upsert fail</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-Query-Server-upsert-fail/m-p/95899#M9296</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/223/jelser.html" nodeid="223"&gt;@Josh Elser&lt;/A&gt;&lt;P&gt; statementId only existis in new version of phoenix. I built it locally, replaced phoenix jars and tried with commands you sent, but same issue happened, new rows were not inserted/updated.&lt;/P&gt;&lt;P&gt;I ended finding the solution for both versions (2.3.2 and new phoenix version), we just need to add: phoenix.connection.autoCommit=true to hbase-site.xml (can be set using ambari as well).&lt;/P&gt;&lt;P&gt;Is phoenix server missing the commit?&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2015 08:17:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-Query-Server-upsert-fail/m-p/95899#M9296</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2015-10-24T08:17:49Z</dc:date>
    </item>
  </channel>
</rss>

