This is an automated email from the ASF dual-hosted git repository. nixon pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 3084ed1865c5b5aa788ec8d9be998fac1721784b Author: Mandar Ambawane <mandar.ambaw...@freestoneinfotech.com> AuthorDate: Tue Feb 16 12:42:22 2021 +0530 ATLAS-4135 [Atlas: Glossary Term Bulk Import] It will be good to ignore the glossaries and terms that are already present instead of failing the bulk import. ATLAS-4139 [Atlas: Glossary Term Bulk Import] When AdditionalAttributes is not provided in key:value format, the error message does not convey that. (cherry picked from commit 5d0eba4e7a92afd11fd47f47d7352a976af430e0) --- .../src/main/java/org/apache/atlas/glossary/GlossaryService.java | 4 +++- .../src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java b/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java index 6e10a96..1da3279 100644 --- a/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java +++ b/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java @@ -1104,7 +1104,9 @@ public class GlossaryService { try { ret.add(createTerm(glossaryTerm)); } catch (AtlasBaseException e) { - throw new AtlasBaseException(AtlasErrorCode.FAILED_TO_CREATE_GLOSSARY_TERM, e); + if (!e.getAtlasErrorCode().equals(AtlasErrorCode.GLOSSARY_TERM_ALREADY_EXISTS)) { + throw new AtlasBaseException(AtlasErrorCode.FAILED_TO_CREATE_GLOSSARY_TERM, e); + } } } diff --git a/repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java b/repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java index 2c84ec7..0871ab5 100644 --- a/repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java +++ b/repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java @@ -623,7 +623,8 @@ public class GlossaryTermUtils extends GlossaryUtils { if ((recordArray.length % 2) == 0) { ret.put(recordArray[0], recordArray[1]); } else { - failedTermMsgs.add("\n" + "The Data in the uploaded file is incorrectly specified : " + csvRecord); + failedTermMsgs.add("\n" + "The Data in the uploaded file is incorrectly specified : " + csvRecord + + "\n" + "AdditionalAttributes needs to be a key:value pair"); } } }