Fix #1824: ES index live check if tableType is set (#1825)

* Fix #1824: ES index live check if tableType is set
This commit is contained in:
Sriharsha Chintalapani 2021-12-17 11:06:41 -08:00 committed by GitHub
parent c3113ffcba
commit 5a2c97724f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

1
.gitignore vendored
View File

@ -46,6 +46,7 @@ logs
.idea/libraries/ .idea/libraries/
.idea/modules.xml .idea/modules.xml
.idea/dataSources.xml .idea/dataSources.xml
.idea/encodings.xml
# Package Files # Package Files
*.jar *.jar

1
.idea/encodings.xml generated
View File

@ -5,6 +5,5 @@
<file url="file://$PROJECT_DIR$/catalog-rest-service/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/catalog-rest-service/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/catalog-rest-service/src/main/resources/json/data" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/catalog-rest-service/src/main/resources/json/data" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/common/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/openmetadata-ui/src/main/resources/ui/dist" charset="UTF-8" />
</component> </component>
</project> </project>

View File

@ -287,6 +287,7 @@ class ParseTags {
@Value @Value
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
class TableESIndex extends ElasticSearchIndex { class TableESIndex extends ElasticSearchIndex {
@JsonProperty("table_id") @JsonProperty("table_id")
String tableId; String tableId;
@ -323,6 +324,7 @@ class TableESIndex extends ElasticSearchIndex {
String tableId = table.getId().toString(); String tableId = table.getId().toString();
String tableName = table.getName(); String tableName = table.getName();
String description = table.getDescription() != null ? table.getDescription() : ""; String description = table.getDescription() != null ? table.getDescription() : "";
String tableType = table.getTableType() != null ? table.getTableType().toString(): "Regular";
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<>();
@ -361,7 +363,7 @@ class TableESIndex extends ElasticSearchIndex {
.serviceCategory("databaseService") .serviceCategory("databaseService")
.columnNames(columnNames) .columnNames(columnNames)
.columnDescriptions(columnDescriptions) .columnDescriptions(columnDescriptions)
.tableType(table.getTableType().toString()) .tableType(tableType)
.tags(parseTags.tags) .tags(parseTags.tags)
.tier(parseTags.tierTag); .tier(parseTags.tierTag);