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