<?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: get human readable JSON from the HBase rest service in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/get-human-readable-JSON-from-the-HBase-rest-service/m-p/199520#M62424</link>
    <description>&lt;P&gt;No, there is presently no option to do what you're asking. HBase stores arbitrary bytes which means that data in any portion of the response object may generate invalid JSON.&lt;/P&gt;&lt;P&gt;If you do chose to write some software to solve your issue, I would guess that the Apache HBase community would be accepting of some option/configuration that does add what you're asking for to the REST server.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2017 22:04:03 GMT</pubDate>
    <dc:creator>elserj</dc:creator>
    <dc:date>2017-06-06T22:04:03Z</dc:date>
    <item>
      <title>get human readable JSON from the HBase rest service</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/get-human-readable-JSON-from-the-HBase-rest-service/m-p/199519#M62423</link>
      <description>&lt;P&gt;HBase has a convenient REST service, e.g. if we create some records in an HBase table:&lt;/P&gt;&lt;PRE&gt;$ hbase shell
hbase(main):001:0&amp;gt; create 'profile', 'demographics'
hbase(main):002:0&amp;gt; put 'profile', 1234, 'demographics:age', 42
hbase(main):003:0&amp;gt; put 'profile', 1234, 'demographics:gender', 'F'
hbase(main):004:0&amp;gt; put 'profile', 2345, 'demographics:age', 8
hbase(main):005:0&amp;gt; put 'profile', 2345, 'demographics:gender', 'M'

hbase(main):006:0&amp;gt; scan 'profile'
ROW     COLUMN+CELL
1234    column=demographics:age, timestamp=1496754873362, value=42
1234    column=demographics:gender, timestamp=1496754880025, value=F
2345    column=demographics:age, timestamp=1496754886334, value=8
2345    column=demographics:gender, timestamp=1496754891898, value=M&lt;/PRE&gt;&lt;P&gt;... and start the HBase REST service:&lt;/P&gt;&lt;PRE&gt;[root@hdp03 ~]# hbase rest start&lt;/PRE&gt;&lt;P&gt;We can retrieve the values by making calls to the HBase REST service:&lt;/P&gt;&lt;PRE&gt;$ curl 'http://hdp03.woolford.io:8080/profile/1234' -H "Accept: application/json"
{
	"Row": [{
		"key": "MTIzNA==",
		"Cell": [{
			"column": "ZGVtb2dyYXBoaWNzOmFnZQ==",
			"timestamp": 1496754873362,
			"$": "NDI="
		}, {
			"column": "ZGVtb2dyYXBoaWNzOmdlbmRlcg==",
			"timestamp": 1496754880025,
			"$": "Rg=="
		}]
	}]
}
&lt;/PRE&gt;&lt;P&gt;I notice that the HBase column names and cell values returned by the HBase REST service are base64 encoded:&lt;/P&gt;&lt;PRE&gt;$ python
&amp;gt;&amp;gt;&amp;gt; import base64
&amp;gt;&amp;gt;&amp;gt; base64.b64decode("MTIzNA==")
'1234'
&amp;gt;&amp;gt;&amp;gt; base64.b64decode("ZGVtb2dyYXBoaWNzOmFnZQ==")
'demographics:age'
&amp;gt;&amp;gt;&amp;gt; base64.b64decode("NDI=")
'42'
&amp;gt;&amp;gt;&amp;gt; base64.b64decode("ZGVtb2dyYXBoaWNzOmdlbmRlcg==")
'demographics:gender'
&amp;gt;&amp;gt;&amp;gt; base64.b64decode("Rg==")
'F'
&lt;/PRE&gt;&lt;P&gt;That's great for machine-to-machine communication, e.g. a webservice, but isn't very user-friendly since base64 isn't human readable. Is there a simple way (e.g. header parameter, HBase property) to make the HBase REST service return human-readable JSON? I realize I could write my own service, but I'd rather re-use existing code/functionality if possible.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 21:15:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/get-human-readable-JSON-from-the-HBase-rest-service/m-p/199519#M62423</guid>
      <dc:creator>awoolford</dc:creator>
      <dc:date>2017-06-06T21:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: get human readable JSON from the HBase rest service</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/get-human-readable-JSON-from-the-HBase-rest-service/m-p/199520#M62424</link>
      <description>&lt;P&gt;No, there is presently no option to do what you're asking. HBase stores arbitrary bytes which means that data in any portion of the response object may generate invalid JSON.&lt;/P&gt;&lt;P&gt;If you do chose to write some software to solve your issue, I would guess that the Apache HBase community would be accepting of some option/configuration that does add what you're asking for to the REST server.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 22:04:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/get-human-readable-JSON-from-the-HBase-rest-service/m-p/199520#M62424</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2017-06-06T22:04:03Z</dc:date>
    </item>
  </channel>
</rss>

