<?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: Getting hbase rowkey in morphlines in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-hbase-rowkey-in-morphlines/m-p/47233#M45570</link>
    <description>&lt;P&gt;Found the solution!&lt;BR /&gt;&lt;A href="https://groups.google.com/forum/#!searchin/hbase-indexer-user/rowkey%7Csort:relevance/hbase-indexer-user/eitg7QquxRI/MfVA6SXInM8J" target="_blank"&gt;https://groups.google.com/forum/#!searchin/hbase-indexer-user/rowkey%7Csort:relevance/hbase-indexer-user/eitg7QquxRI/MfVA6SXInM8J&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Post by Wolfgang:&lt;/P&gt;&lt;PRE&gt;You can fetch it (edited: the rowkey) by pasting this code snippet into a “java” morphline command:
org.apache.hadoop.hbase.client.Result result = (org.apache.hadoop.hbase.client.Result) record.getFirstValue("_attachment_body");
byte[] rowKey = result.getRow(); 
record.put("myRowKey", rowKey);
Possible gotcha: Make sure that this java command appears *before* the extractHBaseCells morphline command in the morphline config file.
http://kitesdk.org/docs/current/morphlines/morphlines-reference-guide.html#java&lt;/PRE&gt;&lt;P&gt;Gin&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2016 17:59:34 GMT</pubDate>
    <dc:creator>ginsul</dc:creator>
    <dc:date>2016-11-09T17:59:34Z</dc:date>
    <item>
      <title>Getting hbase rowkey in morphlines</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-hbase-rowkey-in-morphlines/m-p/47165#M45568</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using&amp;nbsp;&lt;SPAN class="s1"&gt;extractHBaseCells morphlines command to index&amp;nbsp;hbase data into solr.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How do I get HBase&amp;nbsp;rowkey?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to construct a URI-based ID from the given rowkey as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;          setValues: {
            id : "http://hbase_ids.com/@{rowkey}"
          }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gin&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:47:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-hbase-rowkey-in-morphlines/m-p/47165#M45568</guid>
      <dc:creator>ginsul</dc:creator>
      <dc:date>2022-09-16T10:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Getting hbase rowkey in morphlines</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-hbase-rowkey-in-morphlines/m-p/47223#M45569</link>
      <description>I have looked at the source code. The most maintenance-friendly solution would be to create a custom mapper class and do some "hacks" there.&lt;BR /&gt;&lt;BR /&gt;However, the provided mapper classes are final (thus no decent reuse) and I haven't found a way to configure hbase-indexer classpath via Cloudera manager.</description>
      <pubDate>Wed, 09 Nov 2016 14:47:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-hbase-rowkey-in-morphlines/m-p/47223#M45569</guid>
      <dc:creator>ginsul</dc:creator>
      <dc:date>2016-11-09T14:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting hbase rowkey in morphlines</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-hbase-rowkey-in-morphlines/m-p/47233#M45570</link>
      <description>&lt;P&gt;Found the solution!&lt;BR /&gt;&lt;A href="https://groups.google.com/forum/#!searchin/hbase-indexer-user/rowkey%7Csort:relevance/hbase-indexer-user/eitg7QquxRI/MfVA6SXInM8J" target="_blank"&gt;https://groups.google.com/forum/#!searchin/hbase-indexer-user/rowkey%7Csort:relevance/hbase-indexer-user/eitg7QquxRI/MfVA6SXInM8J&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Post by Wolfgang:&lt;/P&gt;&lt;PRE&gt;You can fetch it (edited: the rowkey) by pasting this code snippet into a “java” morphline command:
org.apache.hadoop.hbase.client.Result result = (org.apache.hadoop.hbase.client.Result) record.getFirstValue("_attachment_body");
byte[] rowKey = result.getRow(); 
record.put("myRowKey", rowKey);
Possible gotcha: Make sure that this java command appears *before* the extractHBaseCells morphline command in the morphline config file.
http://kitesdk.org/docs/current/morphlines/morphlines-reference-guide.html#java&lt;/PRE&gt;&lt;P&gt;Gin&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 17:59:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-hbase-rowkey-in-morphlines/m-p/47233#M45570</guid>
      <dc:creator>ginsul</dc:creator>
      <dc:date>2016-11-09T17:59:34Z</dc:date>
    </item>
  </channel>
</rss>

