diff --git a/repository/src/main/java/org/apache/atlas/repository/store/aliasstore/ESAliasStore.java b/repository/src/main/java/org/apache/atlas/repository/store/aliasstore/ESAliasStore.java index f10455208c..220d380077 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/aliasstore/ESAliasStore.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/aliasstore/ESAliasStore.java @@ -178,7 +178,7 @@ private Map getFilterForPurpose(AtlasEntity purpose) throws Atla private void personaPolicyToESDslClauses(List policies, List> allowClauseList) throws AtlasBaseException { - List terms = new ArrayList<>(); + Set terms = new HashSet<>(); Set glossaryQualifiedNames =new HashSet<>(); for (AtlasEntity policy: policies) { @@ -249,8 +249,8 @@ private void personaPolicyToESDslClauses(List policies, } } - allowClauseList.add(mapOf("terms", mapOf(QUALIFIED_NAME, terms))); - + allowClauseList.add(mapOf("terms", mapOf(QUALIFIED_NAME, new ArrayList<>(terms)))); + if (CollectionUtils.isNotEmpty(glossaryQualifiedNames)) { allowClauseList.add(mapOf("terms", mapOf(GLOSSARY_PROPERTY_KEY, new ArrayList<>(glossaryQualifiedNames)))); }