sheetalshah1007 commented on code in PR #478:
URL: https://github.com/apache/atlas/pull/478#discussion_r3080780980
##########
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java:
##########
@@ -1533,6 +1532,98 @@ private void mapRelationshipAttributes(AtlasEntity
entity, AtlasEntityType entit
LOG.debug("<== mapRelationshipAttributes({}, {})", op,
entity.getTypeName());
}
+ private void mapRelationshipAttributeWithMultipleTypes(AtlasEntity entity,
AtlasEntityType entityType, String attrName, Object attrValue, AtlasVertex
vertex, EntityOperation op, EntityMutationContext context) throws
AtlasBaseException {
+ LOG.debug("==> mapRelationshipAttributeWithMultipleTypes({}, {})",
attrName, entity.getTypeName());
+ Set<String> relationshipTypeNames =
entityType.getAttributeRelationshipTypes(attrName);
+
+ if (CollectionUtils.isEmpty(relationshipTypeNames)) {
+ // Fallback to single relationship type processing
+ String relationType =
AtlasEntityUtil.getRelationshipType(attrValue);
+ AtlasAttribute attribute =
entityType.getRelationshipAttribute(attrName, relationType);
+ mapAttribute(attribute, attrValue, vertex, op, context);
+
+ return;
+ }
+
+ if (attrValue instanceof Collection) {
Review Comment:
This change isn’t tied to one combination like “`hive_db + hive_table +
iceberg_table.`” It applies whenever one attribute name can point to more than
one relationship type. We sort the refs by type and map them in separate steps.
**Maps**:
Map-valued relationship attribute is not supported yet
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]