Fix #1822: ES live updates are failing when description is null (#1823)

This commit is contained in:
Sriharsha Chintalapani 2021-12-17 09:32:34 -08:00 committed by GitHub
parent 1bd1f99a47
commit c3113ffcba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,7 +322,7 @@ class TableESIndex extends ElasticSearchIndex {
public static TableESIndexBuilder builder(Table table, int responseCode) {
String tableId = table.getId().toString();
String tableName = table.getName();
String description = table.getDescription();
String description = table.getDescription() != null ? table.getDescription() : "";
List<String> tags = new ArrayList<>();
List<String> columnNames = new ArrayList<>();
List<String> columnDescriptions = new ArrayList<>();
@ -469,12 +469,14 @@ class TopicESIndex extends ElasticSearchIndex {
}
ParseTags parseTags = new ParseTags(tags);
Long updatedTimestamp = topic.getUpdatedAt().getTime();
String description = topic.getDescription() != null ? topic.getDescription() : "";
String displayName = topic.getDisplayName() != null ? topic.getDisplayName() : "";
TopicESIndexBuilder topicESIndexBuilder =
internalBuilder()
.topicId(topic.getId().toString())
.name(topic.getName())
.displayName(topic.getDisplayName())
.description(topic.getDescription())
.displayName(displayName)
.description(description)
.fqdn(topic.getFullyQualifiedName())
.lastUpdatedTimestamp(updatedTimestamp)
.suggest(suggest)
@ -565,12 +567,14 @@ class DashboardESIndex extends ElasticSearchIndex {
chartDescriptions.add(chart.getDescription());
}
ParseTags parseTags = new ParseTags(tags);
String description = dashboard.getDescription() != null ? dashboard.getDescription() : "";
String displayName = dashboard.getDisplayName() != null ? dashboard.getDisplayName() : "";
DashboardESIndexBuilder dashboardESIndexBuilder =
internalBuilder()
.dashboardId(dashboard.getId().toString())
.name(dashboard.getDisplayName())
.displayName(dashboard.getDisplayName())
.description(dashboard.getDescription())
.displayName(displayName)
.description(description)
.fqdn(dashboard.getFullyQualifiedName())
.lastUpdatedTimestamp(updatedTimestamp)
.chartNames(chartNames)
@ -651,12 +655,14 @@ class PipelineESIndex extends ElasticSearchIndex {
}
Long updatedTimestamp = pipeline.getUpdatedAt().getTime();
ParseTags parseTags = new ParseTags(tags);
String description = pipeline.getDescription() != null ? pipeline.getDescription() : "";
String displayName = pipeline.getDisplayName() != null ? pipeline.getDisplayName() : "";
PipelineESIndexBuilder pipelineESIndexBuilder =
internalBuilder()
.pipelineId(pipeline.getId().toString())
.name(pipeline.getDisplayName())
.displayName(pipeline.getDisplayName())
.description(pipeline.getDescription())
.displayName(description)
.description(displayName)
.fqdn(pipeline.getFullyQualifiedName())
.lastUpdatedTimestamp(updatedTimestamp)
.taskNames(taskNames)