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.
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 @@
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 @@
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");
}
}
}