From d790748961cf5e8deac2eff8e31f0a4ae556aa43 Mon Sep 17 00:00:00 2001 From: aarshi Date: Fri, 25 Oct 2024 17:26:35 +0530 Subject: [PATCH 1/2] undo condition --- .../main/java/org/apache/atlas/type/AtlasTypeRegistry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java b/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java index ed84213dfa..0c3fa8c8b7 100644 --- a/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java +++ b/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java @@ -91,13 +91,13 @@ public AtlasType getType(String typeName) throws AtlasBaseException { AtlasType ret = registryData.allTypes.getTypeByName(typeName); if (ret == null ) { - if (!StringUtils.isEmpty(typeName) && typeName.startsWith(ATLAS_TYPE_ARRAY_PREFIX) && typeName.endsWith(ATLAS_TYPE_ARRAY_SUFFIX)) { + if (typeName.startsWith(ATLAS_TYPE_ARRAY_PREFIX) && typeName.endsWith(ATLAS_TYPE_ARRAY_SUFFIX)) { int startIdx = ATLAS_TYPE_ARRAY_PREFIX.length(); int endIdx = typeName.length() - ATLAS_TYPE_ARRAY_SUFFIX.length(); String elementTypeName = typeName.substring(startIdx, endIdx); ret = new AtlasArrayType(elementTypeName, this); - } else if (!StringUtils.isEmpty(typeName) && typeName.startsWith(ATLAS_TYPE_MAP_PREFIX) && typeName.endsWith(ATLAS_TYPE_MAP_SUFFIX)) { + } else if (typeName.startsWith(ATLAS_TYPE_MAP_PREFIX) && typeName.endsWith(ATLAS_TYPE_MAP_SUFFIX)) { int startIdx = ATLAS_TYPE_MAP_PREFIX.length(); int endIdx = typeName.length() - ATLAS_TYPE_MAP_SUFFIX.length(); String[] keyValueTypes = typeName.substring(startIdx, endIdx).split(ATLAS_TYPE_MAP_KEY_VAL_SEP, 2); From fccce0a8d254a20c95a8664fd5b5d45a3efca49a Mon Sep 17 00:00:00 2001 From: aarshi Date: Fri, 25 Oct 2024 17:28:44 +0530 Subject: [PATCH 2/2] add logs --- .../repository/store/graph/v2/EntityGraphRetriever.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java index 5fbd352be2..34d3036042 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java @@ -1685,11 +1685,15 @@ private AtlasStruct mapVertexToStruct(AtlasVertex entityVertex, String edgeLabel if (GraphHelper.elementExists(edge)) { final AtlasVertex referenceVertex = edge.getInVertex(); + if (referenceVertex == null) { + LOG.error("reference vertex not found on edge {} from vertex {} ", edge.getId(), getGuid(entityVertex)); + return ret; + } + String typeName = getTypeName(referenceVertex); if (StringUtils.isEmpty(typeName)) { - LOG.error("typeName not found for in-vertex {} on edge {} from vertex {} ", - getGuid(referenceVertex), edge.getId(), getGuid(entityVertex)); + LOG.error("typeName not found on edge {} from vertex {} ", edge.getId(), getGuid(entityVertex)); return ret; }