Skip to content

Commit

Permalink
Merge pull request #3183 from atlanhq/PLT-1638-dynamictable-fix
Browse files Browse the repository at this point in the history
Plt 1638 dynamictable fix
  • Loading branch information
sumandas0 authored Jun 3, 2024
2 parents 4add05b + c004d35 commit 69f15b0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,10 @@ private DirectIndexQueryResult getResultFromResponse(Map<String, LinkedHashMap>
if (hits_0 == null) {
return result;
}
this.vertexTotals = (Integer) hits_0.get("total").get("value");
LinkedHashMap approximateCount = hits_0.get("total");
if (approximateCount != null) {
this.vertexTotals = (Integer) approximateCount.get("value");
}

List<LinkedHashMap> hits_1 = AtlasType.fromJson(AtlasType.toJson(hits_0.get("hits")), List.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> TYPENAMES_TO_SKIP_SUPER_TYPE_CHECK = new ArrayList<String>() {{
add("Table");
}};
protected RegistryData registryData;
private final TypeRegistryUpdateSynchronizer updateSynchronizer;
private final Set<String> missingRelationshipDefs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 69f15b0

Please sign in to comment.