Skip to content

Commit

Permalink
Evaluate attrName in appendRelationshipAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshi0301 committed Dec 27, 2023
1 parent 1ab182a commit 06a1467
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ private void visitRelationships(AtlasEntityType entityType, AtlasEntity entity,
for (String attrName : entityType.getRelationshipAttributes().keySet()) {

// if attribute is not in 'relationshipAttributes', try 'attributes'
// if appendRelationshipAttribute exists try attrName there
if (entity.hasRelationshipAttribute(attrName)) {
Object attrVal = entity.getRelationshipAttribute(attrName);
String relationshipType = AtlasEntityUtil.getRelationshipType(attrVal);
Expand All @@ -374,6 +375,15 @@ private void visitRelationships(AtlasEntityType entityType, AtlasEntity entity,
visitAttribute(attribute.getAttributeType(), attrVal, entity.getGuid());

visitedAttributes.add(attrName);
} else if (entity.hasAppendRelationshipAttribute(attrName)){
Object attrVal = entity.getRelationshipAttribute(attrName);
String relationshipType = AtlasEntityUtil.getRelationshipType(attrVal);
AtlasAttribute attribute = entityType.getRelationshipAttribute(attrName, relationshipType);

visitAttribute(attribute.getAttributeType(), attrVal, entity.getGuid());

visitedAttributes.add(attrName);

}
}
}
Expand Down

0 comments on commit 06a1467

Please sign in to comment.