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

    https://github.com/apache/metron/pull/827#discussion_r149140207
  
    --- Diff: 
metron-platform/metron-indexing/src/test/java/org/apache/metron/indexing/dao/InMemoryDao.java
 ---
    @@ -221,12 +222,24 @@ public void batchUpdate(Map<Document, 
Optional<String>> updates) throws IOExcept
         }
       }
     
    -  public Map<String, Map<String, FieldType>> 
getColumnMetadata(List<String> indices) throws IOException {
    -    Map<String, Map<String, FieldType>> columnMetadata = new HashMap<>();
    +  @Override
    +  public Map<String, FieldType> getColumnMetadata(List<String> indices) 
throws IOException {
    +    Map<String, FieldType> indexColumnMetadata = new HashMap<>();
         for(String index: indices) {
    -      columnMetadata.put(index, new HashMap<>(COLUMN_METADATA.get(index)));
    +      Map<String, FieldType> columnMetadata = COLUMN_METADATA.get(index);
    +      for (Entry entry: columnMetadata.entrySet()) {
    +        String field = (String) entry.getKey();
    +        FieldType type = (FieldType) entry.getValue();
    +        if (indexColumnMetadata.containsKey(field)) {
    +          if (!type.equals(indexColumnMetadata.get(field))) {
    +            indexColumnMetadata.remove(field);
    --- End diff --
    
    >  The case of columns existing in multiple indices with different types is 
solved by just excluding them from the results.
    
    Why did you choose to exclude these fields?  
    
    What happens If the user adds a new sensor that triggers this condition?  
They add a sensor that has the same name, but different type.  Wouldn't the 
user no longer be able to see that field in the UI?   That seems like it would 
be confusing for the user to understand what has happened.


---

Reply via email to