From 8786dd027726f9c6921415d036e92c6034921112 Mon Sep 17 00:00:00 2001 From: Suman Das <59254445+sumandas0@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:28:32 +0530 Subject: [PATCH] feat: make the qualifiedName list unique --- .../atlas/repository/store/aliasstore/ESAliasStore.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)))); }