Github user nickwallen commented on a diff in the pull request: https://github.com/apache/metron/pull/827#discussion_r149161467 --- Diff: metron-platform/metron-elasticsearch/src/main/java/org/apache/metron/elasticsearch/dao/ElasticsearchDao.java --- @@ -388,22 +388,24 @@ protected UpdateRequest buildUpdateRequest(Document update, String sensorType, S .getMappings(); for(Object key: mappings.keys().toArray()) { String indexName = key.toString(); - - Map<String, FieldType> indexColumnMetadata = new HashMap<>(); ImmutableOpenMap<String, MappingMetaData> mapping = mappings.get(indexName); Iterator<String> mappingIterator = mapping.keysIt(); while(mappingIterator.hasNext()) { MappingMetaData mappingMetaData = mapping.get(mappingIterator.next()); Map<String, Map<String, String>> map = (Map<String, Map<String, String>>) mappingMetaData.getSourceAsMap().get("properties"); for(String field: map.keySet()) { - indexColumnMetadata.put(field, elasticsearchSearchTypeMap.getOrDefault(map.get(field).get("type"), FieldType.OTHER)); + FieldType type = elasticsearchSearchTypeMap.getOrDefault(map.get(field).get("type"), FieldType.OTHER); + if (indexColumnMetadata.containsKey(field)) { + if (!type.equals(indexColumnMetadata.get(field))) { + indexColumnMetadata.remove(field); --- End diff -- > Whichever approach we do take, I think we should have a big fat, LOG.error here logging the duplicate field names, the index names, and what the impact of this is. Per the other conversation, this is where we actually need the log statement.
---