Commit eb513c31 by Mandar Ambawane Committed by nixonrodrigues

ATLAS-3316 getResolvedEntityVertex returns null if AtlasRelatedObjectId is…

ATLAS-3316 getResolvedEntityVertex returns null if AtlasRelatedObjectId is referenced with AtlasObjectId Signed-off-by: 's avatarnixonrodrigues <nixon@apache.org>
parent e7071476
...@@ -19,6 +19,7 @@ package org.apache.atlas.repository.store.graph; ...@@ -19,6 +19,7 @@ package org.apache.atlas.repository.store.graph;
import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.exception.AtlasBaseException;
import org.apache.atlas.model.instance.AtlasObjectId; import org.apache.atlas.model.instance.AtlasObjectId;
import org.apache.atlas.model.instance.AtlasRelatedObjectId;
import org.apache.atlas.repository.graphdb.AtlasVertex; import org.apache.atlas.repository.graphdb.AtlasVertex;
import org.apache.atlas.repository.store.graph.v2.EntityStream; import org.apache.atlas.repository.store.graph.v2.EntityStream;
import org.apache.atlas.type.AtlasEntityType; import org.apache.atlas.type.AtlasEntityType;
...@@ -95,6 +96,9 @@ public final class EntityGraphDiscoveryContext { ...@@ -95,6 +96,9 @@ public final class EntityGraphDiscoveryContext {
} }
public AtlasVertex getResolvedEntityVertex(AtlasObjectId objId) { public AtlasVertex getResolvedEntityVertex(AtlasObjectId objId) {
if (objId instanceof AtlasRelatedObjectId) {
objId = new AtlasObjectId(objId.getGuid(), objId.getTypeName(), objId.getUniqueAttributes());
}
AtlasVertex vertex = resolvedIdsByUniqAttribs.get(objId); AtlasVertex vertex = resolvedIdsByUniqAttribs.get(objId);
// check also for sub-types; ref={typeName=Asset; guid=abcd} should match {typeName=hive_table; guid=abcd} // check also for sub-types; ref={typeName=Asset; guid=abcd} should match {typeName=hive_table; guid=abcd}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment