Skip to content

Commit

Permalink
compute flag only if property exists
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshi0301 committed Dec 10, 2024
1 parent 1078182 commit dce4f05
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1033,9 +1033,13 @@ private Map<String, Object> preloadProperties(AtlasVertex entityVertex, AtlasEnt
AtlasAttribute attribute = entityType.getAttribute(property.key());
TypeCategory typeCategory = attribute != null ? attribute.getAttributeType().getTypeCategory() : null;
TypeCategory elementTypeCategory = attribute != null && attribute.getAttributeType().getTypeCategory() == TypeCategory.ARRAY ? ((AtlasArrayType) attribute.getAttributeType()).getElementType().getTypeCategory() : null;
boolean isMultiValuedProperty = (property instanceof CacheVertexProperty && ((CacheVertexProperty) property).propertyKey().cardinality().equals(Cardinality.SET));

if (property.isPresent()) {

// If the attribute is not known (null)
// validate if it is multi-valued
boolean isMultiValuedProperty = (property instanceof CacheVertexProperty && ((CacheVertexProperty) property).propertyKey().cardinality().equals(Cardinality.SET));

if (typeCategory == TypeCategory.ARRAY && elementTypeCategory == TypeCategory.PRIMITIVE) {
updateAttrValue(propertiesMap, property);
} else if (attribute == null && isMultiValuedProperty) {
Expand Down

0 comments on commit dce4f05

Please sign in to comment.