Github user merrimanr commented on a diff in the pull request:

    https://github.com/apache/metron/pull/824#discussion_r150995571
  
    --- Diff: 
metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/HBaseDao.java
 ---
    @@ -138,9 +142,17 @@ private Document getDocumentFromResult(Result result) 
throws IOException {
         Map.Entry<byte[], byte[]> entry= columns.lastEntry();
         Long ts = Bytes.toLong(entry.getKey());
         if(entry.getValue()!= null) {
    -      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);
    +      Map<String, Object> json = JSONUtils.INSTANCE.load(new 
String(entry.getValue()),
    +          new TypeReference<Map<String, Object>>() {});
    +      ByteArrayInputStream baos = new 
ByteArrayInputStream(result.getRow());
    --- End diff --
    
    I initially tried to do this but if felt sort of awkward since we need to 
return both the guid and sensorType.  Would it make sense to just return a 
Document with those fields set and set the other fields after that method is 
called?  Or we could accept the json and ts as inputs to that method too.


---

Reply via email to