Github user merrimanr commented on a diff in the pull request:
https://github.com/apache/metron/pull/824#discussion_r150874132
--- Diff:
metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/HBaseDao.java
---
@@ -135,8 +138,9 @@ private Document getDocumentFromResult(Result result)
throws IOException {
Map.Entry<byte[], byte[]> entry= columns.lastEntry();
Long ts = Bytes.toLong(entry.getKey());
if(entry.getValue()!= null) {
- String json = new String(entry.getValue());
- return new Document(json, Bytes.toString(result.getRow()), null, ts);
+ Map<String, Object> json = JSONUtils.INSTANCE.load(new
String(entry.getValue()), new TypeReference<Map<String, Object>>() {
+ });
+ return new Document(json, Bytes.toString(result.getRow()), (String)
json.get(SOURCE_TYPE), ts);
--- End diff --
That seems generally useful but it's a pretty significant change (several
files and several lines of code) plus it adds another setting to our config.
There is no unit test for IndexConfig so it also adds untested code (or would
require writing a new test).
I prefer a simple 2-3 line change that we can easily revert when ES 5
upgrade makes it in. This should be a separate PR in my opinion. This PR is
already very large and complicated.
---