mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 03:46:10 +00:00
Fix DataInsights Field Getter (#17427)
This commit is contained in:
parent
2dfd7d1f70
commit
c221f80d15
@ -2010,6 +2010,7 @@ public class ElasticSearchClient implements SearchClient {
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> fetchDIChartFields() throws IOException {
|
||||
List<Map<String, String>> fields = new ArrayList<>();
|
||||
GetMappingsRequest request =
|
||||
new GetMappingsRequest().indices(DataInsightSystemChartRepository.DI_SEARCH_INDEX);
|
||||
|
||||
@ -2020,11 +2021,9 @@ public class ElasticSearchClient implements SearchClient {
|
||||
for (Map.Entry<String, MappingMetadata> entry : response.mappings().entrySet()) {
|
||||
// Get fields for the index
|
||||
Map<String, Object> indexFields = entry.getValue().sourceAsMap();
|
||||
List<Map<String, String>> fields = new ArrayList<>();
|
||||
getFieldNames((Map<String, Object>) indexFields.get("properties"), "", fields);
|
||||
return fields;
|
||||
}
|
||||
return null;
|
||||
return fields;
|
||||
}
|
||||
|
||||
void getFieldNames(
|
||||
@ -2045,11 +2044,13 @@ public class ElasticSearchClient implements SearchClient {
|
||||
getFieldNames(
|
||||
(Map<String, Object>) subFields.get("properties"), fieldName + ".", fieldList);
|
||||
} else {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("name", fieldName);
|
||||
map.put("displayName", fieldNameOriginal);
|
||||
map.put("type", type);
|
||||
fieldList.add(map);
|
||||
if (fieldList.stream().noneMatch(e -> e.get("name").equals(fieldName))) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("name", fieldName);
|
||||
map.put("displayName", fieldNameOriginal);
|
||||
map.put("type", type);
|
||||
fieldList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1987,6 +1987,7 @@ public class OpenSearchClient implements SearchClient {
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> fetchDIChartFields() throws IOException {
|
||||
List<Map<String, String>> fields = new ArrayList<>();
|
||||
GetMappingsRequest request =
|
||||
new GetMappingsRequest().indices(DataInsightSystemChartRepository.DI_SEARCH_INDEX);
|
||||
|
||||
@ -1997,11 +1998,9 @@ public class OpenSearchClient implements SearchClient {
|
||||
for (Map.Entry<String, MappingMetadata> entry : response.mappings().entrySet()) {
|
||||
// Get fields for the index
|
||||
Map<String, Object> indexFields = entry.getValue().sourceAsMap();
|
||||
List<Map<String, String>> fields = new ArrayList<>();
|
||||
getFieldNames((Map<String, Object>) indexFields.get("properties"), "", fields);
|
||||
return fields;
|
||||
}
|
||||
return null;
|
||||
return fields;
|
||||
}
|
||||
|
||||
void getFieldNames(
|
||||
@ -2022,11 +2021,13 @@ public class OpenSearchClient implements SearchClient {
|
||||
getFieldNames(
|
||||
(Map<String, Object>) subFields.get("properties"), fieldName + ".", fieldList);
|
||||
} else {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("name", fieldName);
|
||||
map.put("displayName", fieldNameOriginal);
|
||||
map.put("type", type);
|
||||
fieldList.add(map);
|
||||
if (fieldList.stream().noneMatch(e -> e.get("name").equals(fieldName))) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("name", fieldName);
|
||||
map.put("displayName", fieldNameOriginal);
|
||||
map.put("type", type);
|
||||
fieldList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user