<?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 phoenix upsert boolean values in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128399#M43390</link>
    <description>&lt;P&gt;I am inserting a csv file using the apache phoenix insert python utility and i have field in the phoenix table which holds a boolean value. In the csv file that value is represented as 1/0 and when it goes into phoenix it should go as true/false. but it is going as false/true. Any thoughts on this. The CSV file used as an import is generated through an ETL from mysql source.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2016 14:12:06 GMT</pubDate>
    <dc:creator>arunpoy</dc:creator>
    <dc:date>2016-10-13T14:12:06Z</dc:date>
    <item>
      <title>phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128399#M43390</link>
      <description>&lt;P&gt;I am inserting a csv file using the apache phoenix insert python utility and i have field in the phoenix table which holds a boolean value. In the csv file that value is represented as 1/0 and when it goes into phoenix it should go as true/false. but it is going as false/true. Any thoughts on this. The CSV file used as an import is generated through an ETL from mysql source.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 14:12:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128399#M43390</guid>
      <dc:creator>arunpoy</dc:creator>
      <dc:date>2016-10-13T14:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128400#M43391</link>
      <description>&lt;P&gt;"In the csv file that value is represented as 1/0 and when it goes into 
phoenix it should go as true/false. but it is going as false/true"&lt;/P&gt;&lt;PRE&gt;&amp;gt; create table booltest(pk varchar not null primary key, truth boolean);
&amp;gt; upsert into booltest values('true', 1);
Error: ERROR 203 (22005): Type mismatch. INTEGER cannot be coerced to BOOLEAN (state=22005,code=203)&lt;/PRE&gt;&lt;P&gt;It seems like UPSERTS will not coerce integers into a boolean. I'm curious how the CSV tool is doing this. psql.py seems to do this fine:&lt;/P&gt;&lt;PRE&gt;$ echo "true,1" &amp;gt; ~/booleans.csv
$ echo "false,0" &amp;gt;&amp;gt; ~/booleans.csv
$ /usr/local/lib/phoenix/bin/psql.py -t BOOLTEST localhost:2181:/hbase-1.2 ~/booleans.csv
$ sqlline.py ...
&amp;gt; 0: jdbc:phoenix:localhost:2181:/hbase-1.2&amp;gt; select * from booltest;
+--------+--------+
|   PK   | TRUTH  |
+--------+--------+
| false  | false  |
| true   | true   |
+--------+--------+
&lt;/PRE&gt;&lt;P&gt;Similarly, using the CsvBulkLoadTool shows the same for me:&lt;/P&gt;&lt;PRE&gt;yarn jar /usr/local/lib/phoenix/phoenix-4.9.0-HBase-1.2-SNAPSHOT-client.jar org.apache.phoenix.mapreduce.CsvBulkLoadTool -Dmapred.map.child.java.opts="-Xmx1G" --table BOOLTEST --input booleans.csv -z localhost:2181:/hbase-1.2&lt;/PRE&gt;&lt;P&gt;Maybe do a sanity check on your processing?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 00:30:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128400#M43391</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-10-14T00:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128401#M43392</link>
      <description>&lt;P&gt;HI &lt;A rel="user" href="https://community.cloudera.com/users/223/jelser.html" nodeid="223"&gt;@Josh Elser&lt;/A&gt;, i tried to do the same thing from my environment, but the results are different. I am using the phoenix utility provided by HDP 2.4. any thoughts on this&lt;/P&gt;&lt;PRE&gt;        
$ cat booleans.csv
true,1
false,0
$ /usr/hdp/2.4.0.0-169/phoenix/bin/psql.py -t BOOLTEST -h PK,TRUTH localhost:2181:/hbase-unsecure booleans.csv
0: jdbc:phoenix:localhost:2181:/hbase-unse&amp;gt; select * from BOOLTEST;
+------------------------------------------+------------------------------------------+
|                    PK                    |                  TRUTH                   |
+------------------------------------------+------------------------------------------+
| false                                    | false                                    |
| true                                     | false                                    |
+------------------------------------------+------------------------------------------+&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Oct 2016 11:54:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128401#M43392</guid>
      <dc:creator>arunpoy</dc:creator>
      <dc:date>2016-10-14T11:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128402#M43393</link>
      <description>&lt;P&gt;Oh, that's different than what you said earlier: Both values have "false" (not the values being inverted). Maybe it is a bug with 2.4.0.0. I'll have to see if I can use that exact version and see if I can reproduce the issue.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 22:54:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128402#M43393</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-10-14T22:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128403#M43394</link>
      <description>&lt;P&gt;It is related to &lt;A href="https://issues.apache.org/jira/browse/PHOENIX-2434"&gt;PHOENIX-2434&lt;/A&gt;, which has been fixed in HDP 2.5/ apache v4.7.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2016 02:09:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128403#M43394</guid>
      <dc:creator>asinghal</dc:creator>
      <dc:date>2016-10-16T02:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128404#M43395</link>
      <description>&lt;P&gt;Thanks for sharing, Ankit!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 04:26:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128404#M43395</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-10-17T04:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128405#M43396</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/223/jelser.html" nodeid="223"&gt;@Josh Elser&lt;/A&gt; and &lt;A rel="user" href="https://community.cloudera.com/users/627/asinghal.html" nodeid="627"&gt;@Ankit Singhal&lt;/A&gt;. Is there a work around for this, without upgrading it to HDP 2.5 ? As upgrade involves involving lot of teams using the cluster.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 20:05:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128405#M43396</guid>
      <dc:creator>arunpoy</dc:creator>
      <dc:date>2016-10-17T20:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128406#M43397</link>
      <description>&lt;P&gt;This fix may eventually make it into a maintenance release for HDP. If you have a Hortonworks support contract, you can escalate this through them to get a fix made with urgency.&lt;/P&gt;&lt;P&gt;The workaround is to provide "true" and "false" when referring to booleans instead of "1" and "0".&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 22:11:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128406#M43397</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-10-17T22:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128407#M43398</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/223/jelser.html" nodeid="223"&gt;@Josh Elser&lt;/A&gt;, as a work arouns what i did was copied the phoenix 4.8 jars to the hbase classpath on all the nodes and made it work. IS it a good approach to do &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Also as phoenix stores all the version information on the system tables when it gets connected for the first time. Since i have been using phoenix 4.4 earlier and now 4.8 , will it cause any issues for accessign the existing data. Do i need to drop all the tables and create it back?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 14:39:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128407#M43398</guid>
      <dc:creator>arunpoy</dc:creator>
      <dc:date>2016-10-18T14:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix upsert boolean values</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128408#M43399</link>
      <description>&lt;P&gt;That is not a good idea. It is not well tested as to how the version of Phoenix provided in HDP2.3/2.4 works with Apache Phoenix 4.8. You are likely on your own there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 21:45:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-upsert-boolean-values/m-p/128408#M43399</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2016-10-18T21:45:16Z</dc:date>
    </item>
  </channel>
</rss>

