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 4cb7e4a185..82628ce73e 100644 --- a/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java +++ b/intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java @@ -44,6 +44,9 @@ public class AtlasTypeRegistry { private static final Logger LOG = LoggerFactory.getLogger(AtlasTypeRegistry.class); private static final int DEFAULT_LOCK_MAX_WAIT_TIME_IN_SECONDS = 15; + public static final ArrayList TYPENAMES_TO_SKIP_SUPER_TYPE_CHECK = new ArrayList() {{ + add("Table"); + }}; protected RegistryData registryData; private final TypeRegistryUpdateSynchronizer updateSynchronizer; private final Set missingRelationshipDefs; diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java index 5f97d5645c..42d30d39ca 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java @@ -35,8 +35,9 @@ import org.apache.atlas.type.AtlasEntityType; import org.apache.atlas.type.AtlasEnumType; import org.apache.atlas.type.AtlasStructType; -import org.apache.atlas.type.AtlasStructType.AtlasAttribute; +import org.apache.atlas.type.AtlasTypeRegistry; import org.apache.atlas.type.AtlasType; +import org.apache.atlas.type.AtlasStructType.AtlasAttribute; import org.apache.atlas.util.FileUtils; import org.apache.atlas.utils.AtlasPerfMetrics; import org.apache.atlas.utils.AtlasPerfMetrics.MetricRecorder; @@ -349,14 +350,16 @@ public static AtlasVertex findByUniqueAttributes(AtlasGraph graph, AtlasEntityTy vertex = findByTypeAndUniquePropertyName(graph, typeName, uniqAttrValues); // if no instance of given typeName is found, try to find an instance of type's sub-type - if (vertex == null && !entitySubTypes.isEmpty()) { + // Added exception for few types to solve https://atlanhq.atlassian.net/browse/PLT-1638 + if (vertex == null && !entitySubTypes.isEmpty() && !AtlasTypeRegistry.TYPENAMES_TO_SKIP_SUPER_TYPE_CHECK.contains(typeName)) { vertex = findBySuperTypeAndUniquePropertyName(graph, typeName, uniqAttrValues); } } else { vertex = findByTypeAndPropertyName(graph, typeName, attrNameValues); // if no instance of given typeName is found, try to find an instance of type's sub-type - if (vertex == null && !entitySubTypes.isEmpty()) { + // Added exception for few types to solve https://atlanhq.atlassian.net/browse/PLT-1638 + if (vertex == null && !entitySubTypes.isEmpty() && !AtlasTypeRegistry.TYPENAMES_TO_SKIP_SUPER_TYPE_CHECK.contains(typeName)) { vertex = findBySuperTypeAndPropertyName(graph, typeName, attrNameValues); } }