You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2019/07/05 22:23:45 UTC
[atlas] 05/06: ATLAS-3316 getResolvedEntityVertex returns null if
AtlasRelatedObjectId is referenced with AtlasObjectId
This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit ae306ddfec258361ac46b6b2e8dabdd780f9426d
Author: Mandar Ambawane <ma...@freestoneinfotech.com>
AuthorDate: Fri Jul 5 12:04:45 2019 +0530
ATLAS-3316 getResolvedEntityVertex returns null if AtlasRelatedObjectId is referenced with AtlasObjectId
Signed-off-by: nixonrodrigues <ni...@apache.org>
(cherry picked from commit eb513c315607946825831f2f80542b02b9476213)
---
.../atlas/repository/store/graph/EntityGraphDiscoveryContext.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/EntityGraphDiscoveryContext.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/EntityGraphDiscoveryContext.java
index bd05c98..2221ac4 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/EntityGraphDiscoveryContext.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/EntityGraphDiscoveryContext.java
@@ -19,6 +19,7 @@ package org.apache.atlas.repository.store.graph;
import org.apache.atlas.exception.AtlasBaseException;
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.store.graph.v2.EntityStream;
import org.apache.atlas.type.AtlasEntityType;
@@ -95,6 +96,9 @@ public final class EntityGraphDiscoveryContext {
}
public AtlasVertex getResolvedEntityVertex(AtlasObjectId objId) {
+ if (objId instanceof AtlasRelatedObjectId) {
+ objId = new AtlasObjectId(objId.getGuid(), objId.getTypeName(), objId.getUniqueAttributes());
+ }
AtlasVertex vertex = resolvedIdsByUniqAttribs.get(objId);
// check also for sub-types; ref={typeName=Asset; guid=abcd} should match {typeName=hive_table; guid=abcd}