<?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: Insert multiple rows with one request using phoenix query server on Hbase in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110992#M73840</link>
    <description>&lt;P&gt;Yes There is a way.....&lt;/P&gt;&lt;P&gt;Take a look at following working query and modify your code accordingly to generate like queries.&lt;/P&gt;&lt;P&gt; Consider a table XYZ with columns ID,CF.RISK :&lt;/P&gt;&lt;P&gt;UPSERT INTO XYZ(ID,CF.RISK SELECT ID,(CASE ID WHEN '12341e65-a68b-4f88-93ce-33dd94497a6d' THEN 'MEDIUM_RISK' WHEN '73f41e65-a68b-4f88-93ce-33dd94497a6d' THEN 'HIGH_RISK' ELSE 'LOW_RISK' END) FROM ACCOUNTS WHERE ID IN('12341e65-a68b-4f88-93ce-33dd94497a6d','73f41e65-a68b-4f88-93ce-33dd94497a6d')&lt;/P&gt;&lt;P&gt;It updates column CF.RISK for all ID's in WHERE clause list.&lt;/P&gt;,&lt;P&gt;Yes there is a way;&lt;/P&gt;&lt;P&gt;Take a look at following working query and modify your code accordingly:
Consider a table XYZ with columns ID,CF.RISK;&lt;/P&gt;&lt;P&gt;UPSERT INTO XYZ(ID,CF.RISK SELECT ID,(CASE ID WHEN '12341e65-a68b-4f88-93ce-33dd94497a6d' THEN 'MEDIUM_RISK' WHEN '73f41e65-a68b-4f88-93ce-33dd94497a6d' THEN 'HIGH_RISK' ELSE 'LOW_RISK' END) FROM ACCOUNTS WHERE ID IN('12341e65-a68b-4f88-93ce-33dd94497a6d','73f41e65-a68b-4f88-93ce-33dd94497a6d')&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2017 19:57:49 GMT</pubDate>
    <dc:creator>hanjranavneet</dc:creator>
    <dc:date>2017-02-28T19:57:49Z</dc:date>
    <item>
      <title>Insert multiple rows with one request using phoenix query server on Hbase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110986#M73834</link>
      <description>&lt;P&gt;I am looking to combine multiple upsert requests into one request and pass it to the phoenix query server.&lt;/P&gt;&lt;P&gt;I am sending the following json to upsert one record&lt;/P&gt;&lt;PRE&gt;POST &lt;A href="https://tishihdiphoenix.azurehdinsight.net/hbasephoenix/" target="_blank"&gt;https://tishihdiphoenix.azurehdinsight.net/hbasephoenix/&lt;/A&gt; HTTP/1.1
request:{"request":"prepareAndExecute","connectionId":"000000-0000-0000-00000001","sql":""UPSERT INTO Table( col1 ) VALUES ( value1 )":100}
Authorization: Basic YWRtaW46Tm9tb3JlTm9tb3JlIT0x
Host: tishihdiphoenix.azurehdinsight.net
Content-Length: 0
Connection: Keep-Alive&lt;/PRE&gt;&lt;PRE&gt;I want to be able to upsert multiple statements with different values in one json. &lt;/PRE&gt;&lt;PRE&gt;I tried changing the sql statement to something like&lt;/PRE&gt;&lt;PRE&gt;UPSERT INTO Table( col1 ) VALUES ( value1 ), ( value2 ) but that didn't work. I followed the steps to prepare request and then created statement. I got a create response but I couldn't get either the fetch or the execute to work. 

Fetch response &amp;gt; Statement not found, potentially expired. 000000-0000-0000-00000001::1453337888&amp;lt;/pre&amp;gt;&amp;lt;/p&amp;gt;

Execute response &amp;gt; com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "statementHandle" (class org.apache.calcite.avatica.remote.Service$SchemasRequest), not marked as ignorable (2 known properties: , "catalog", "schemaPattern"])
 at [Source: java.io.StringReader@204e1f9c; line: 1, column: 312] (through reference chain: org.apache.calcite.avatica.remote.SchemasRequest["statementHandle"])


Any ideas on what I might need to do after create statement 
 


&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2016 08:20:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110986#M73834</guid>
      <dc:creator>goparaju248</dc:creator>
      <dc:date>2016-01-26T08:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Insert multiple rows with one request using phoenix query server on Hbase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110987#M73835</link>
      <description>&lt;P&gt;What version of HDP are you using? It seems like there is a mismatch between your client and server libraries.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 08:37:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110987#M73835</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-01-26T08:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Insert multiple rows with one request using phoenix query server on Hbase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110988#M73836</link>
      <description>&lt;P&gt;You cannot currently perform multiple upserts within a single HTTP call to the Phoenix QueryServer. &lt;/P&gt;&lt;P&gt;Support for commit/rollback was recently added to Calcite (the technology behind the Phoenix QueryServer) in &lt;A href="https://issues.apache.org/jira/browse/CALCITE-767" target="_blank"&gt;https://issues.apache.org/jira/browse/CALCITE-767&lt;/A&gt; which is relevant for what you're trying to do. However, this was not yet released in a version of HDP. The ability to use commit and rollback lets you batch multiple calls inside of the PQS instance before committing them to HBase.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 08:41:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110988#M73836</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-01-26T08:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Insert multiple rows with one request using phoenix query server on Hbase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110989#M73837</link>
      <description>&lt;P&gt;Thanks for the quick answer, would you happen to know when it would become available?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 09:14:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110989#M73837</guid>
      <dc:creator>goparaju248</dc:creator>
      <dc:date>2016-01-26T09:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Insert multiple rows with one request using phoenix query server on Hbase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110990#M73838</link>
      <description>&lt;P&gt;I believe I am on HDP 2.2 &lt;/P&gt;&lt;P&gt;&lt;A href="http://hortonworks.com/blog/microsoft-azure-hdinsight-on-linux-expands-application-platforms/"&gt;http://hortonworks.com/blog/microsoft-azure-hdinsight-on-linux-expands-application-platforms/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 09:28:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110990#M73838</guid>
      <dc:creator>goparaju248</dc:creator>
      <dc:date>2016-01-26T09:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Insert multiple rows with one request using phoenix query server on Hbase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110991#M73839</link>
      <description>&lt;P&gt;I am not sure, but I can see if we have any public roadmap posted for you.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 11:15:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110991#M73839</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-01-26T11:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Insert multiple rows with one request using phoenix query server on Hbase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110992#M73840</link>
      <description>&lt;P&gt;Yes There is a way.....&lt;/P&gt;&lt;P&gt;Take a look at following working query and modify your code accordingly to generate like queries.&lt;/P&gt;&lt;P&gt; Consider a table XYZ with columns ID,CF.RISK :&lt;/P&gt;&lt;P&gt;UPSERT INTO XYZ(ID,CF.RISK SELECT ID,(CASE ID WHEN '12341e65-a68b-4f88-93ce-33dd94497a6d' THEN 'MEDIUM_RISK' WHEN '73f41e65-a68b-4f88-93ce-33dd94497a6d' THEN 'HIGH_RISK' ELSE 'LOW_RISK' END) FROM ACCOUNTS WHERE ID IN('12341e65-a68b-4f88-93ce-33dd94497a6d','73f41e65-a68b-4f88-93ce-33dd94497a6d')&lt;/P&gt;&lt;P&gt;It updates column CF.RISK for all ID's in WHERE clause list.&lt;/P&gt;,&lt;P&gt;Yes there is a way;&lt;/P&gt;&lt;P&gt;Take a look at following working query and modify your code accordingly:
Consider a table XYZ with columns ID,CF.RISK;&lt;/P&gt;&lt;P&gt;UPSERT INTO XYZ(ID,CF.RISK SELECT ID,(CASE ID WHEN '12341e65-a68b-4f88-93ce-33dd94497a6d' THEN 'MEDIUM_RISK' WHEN '73f41e65-a68b-4f88-93ce-33dd94497a6d' THEN 'HIGH_RISK' ELSE 'LOW_RISK' END) FROM ACCOUNTS WHERE ID IN('12341e65-a68b-4f88-93ce-33dd94497a6d','73f41e65-a68b-4f88-93ce-33dd94497a6d')&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 19:57:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Insert-multiple-rows-with-one-request-using-phoenix-query/m-p/110992#M73840</guid>
      <dc:creator>hanjranavneet</dc:creator>
      <dc:date>2017-02-28T19:57:49Z</dc:date>
    </item>
  </channel>
</rss>

