> On Aug. 24, 2017, 4:58 p.m., Madhan Neethiraj wrote: > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java > > Lines 307 (patched) > > <https://reviews.apache.org/r/61247/diff/4/?file=1802370#file1802370line307> > > > > It looks like lines between #307 and #329 can be replaced with the > > following. This would be easier to read and perhaps a little more > > efficient. Please review. > > > > > > for (AtlasAttribute attribute : entityType.getAllAttributes().values()) > > { > > AtlasType attrType = attribute.getAttributeType(); > > String attrName = attribute.getName(); > > > > if (entity.hasRelationshipAttribute(attrName)) { > > visitAttribute(attrType, > > entity.getRelationshipAttribute(attrName)); > > } else if (entity.hasAttribute(attrName)) { > > visitAttribute(attrType, entity.getAttribute(attrName)); > > } > > }
entityType.getAllAttributes() doesn't include relationship attributes (allAttributes is a member of AtlasStructType), also same attribute (e.g. columns) might be in both relationshipAttributes and attributes - In this case relationshipAttribute value takes precendence. - Sarath ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61247/#review183805 ----------------------------------------------------------- On Aug. 23, 2017, 10:27 a.m., Sarath Subramanian wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61247/ > ----------------------------------------------------------- > > (Updated Aug. 23, 2017, 10:27 a.m.) > > > Review request for atlas, David Radley and Madhan Neethiraj. > > > Bugs: ATLAS-1984 > https://issues.apache.org/jira/browse/ATLAS-1984 > > > Repository: atlas > > > Description > ------- > > AtlasObjectId is used to refer to entity attributes referring to another > entity. > hive_table.columns => List<AtlasObjectId> > hive_table.db => AtlasObjectId > Change this to use AtlasRelatedObjectId with the following structure: > class AtlasRelatedObjectId > { String relationshipGuid; String displayText; AtlasStruct > relationshipAttributes; } > > > Diffs > ----- > > intg/src/main/java/org/apache/atlas/model/instance/AtlasRelationship.java > 41883713 > intg/src/main/java/org/apache/atlas/model/instance/AtlasStruct.java > 80f3a664 > intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 4304e745 > intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 427439ca > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityGraphDiscoveryV1.java > 0210a118 > > repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java > b8fd70e5 > > > Diff: https://reviews.apache.org/r/61247/diff/4/ > > > Testing > ------- > > Tested using POSTMAN REST client > > mvn clean package - In Progress > > > Thanks, > > Sarath Subramanian > >