chaitalicod commented on code in PR #489:
URL: https://github.com/apache/atlas/pull/489#discussion_r2719694896
##########
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:
we are already checking not empty here
if (StringUtils.isNotEmpty(typeName) && entityType == null) {
throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_TYPENAME,
typeName);
}
then is it required to check empty or not here
boolean isRootOrGenericSearch = StringUtils.isEmpty(typeName) ||
(CollectionUtils.isNotEmpty(entityType.getAllSubTypes()) &&
entityType.getSuperTypes().isEmpty());
--
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]