UmeshPatil-1 commented on code in PR #489:
URL: https://github.com/apache/atlas/pull/489#discussion_r2719950936
##########
repository/src/main/java/org/apache/atlas/repository/impexp/StartEntityFetchByExportRequest.java:
##########
@@ -177,15 +189,61 @@ private List<String>
getEntitiesForMatchTypeUsingUniqueAttributes(AtlasObjectId
return new ArrayList<>(ret);
}
- private List<String> getEntitiesForMatchTypeType(AtlasObjectId item,
String matchType) {
- return executeGremlinQuery(getQueryTemplateForMatchType(matchType),
getBindingsForTypeName(item.getTypeName()));
+ private List<String> getEntitiesForMatchTypeType(AtlasObjectId item,
String matchType) throws AtlasBaseException {
+ String typeName = item.getTypeName();
+
+ AtlasEntityType entityType =
typeRegistry.getEntityTypeByName(typeName);
+
+ if (StringUtils.isNotEmpty(typeName) && entityType == null) {
+ throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_TYPENAME,
typeName);
+ }
+
+ boolean isRootOrGenericSearch = StringUtils.isEmpty(typeName) ||
(CollectionUtils.isNotEmpty(entityType.getAllSubTypes()) &&
entityType.getSuperTypes().isEmpty());
Review Comment:
Yes, both checks are required, the first ensures type validity and the
second decides search scope.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]