Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 11-08-2016 07:27 AM - edited 09-16-2022 03:47 AM
Hi,
I am using extractHBaseCells morphlines command to index hbase data into solr.
How do I get HBase rowkey?
I would like to construct a URI-based ID from the given rowkey as follows:
setValues: {
id : "http://hbase_ids.com/@{rowkey}"
}
Thanks,
Gin
Created 11-09-2016 09:59 AM
Found the solution!
https://groups.google.com/forum/#!searchin/hbase-indexer-user/rowkey%7Csort:relevance/hbase-indexer-...
Post by Wolfgang:
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#javaGin
Created 11-09-2016 06:47 AM
Created 11-09-2016 09:59 AM
Found the solution!
https://groups.google.com/forum/#!searchin/hbase-indexer-user/rowkey%7Csort:relevance/hbase-indexer-...
Post by Wolfgang:
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#javaGin