You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by mayank jain <ma...@freestoneinfotech.com> on 2019/10/01 13:08:37 UTC

Re: Review Request 71482: ATLAS-3423:-Import Glossary Terms CSV into a Glossary

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71482/
-----------------------------------------------------------

(Updated Oct. 1, 2019, 1:08 p.m.)


Review request for atlas, Ashutosh Mestry, Nixon Rodrigues, and Sarath Subramanian.


Changes
-------

Patch for ATLAS-3346 - Import GlossaryTerms CSV into a Glossary


Summary (updated)
-----------------

ATLAS-3423:-Import Glossary Terms CSV into a Glossary


Bugs: ATLAS-3423
    https://issues.apache.org/jira/browse/ATLAS-3423


Repository: atlas


Description (updated)
-------

This patch consists implementation for 2 end points first for template download and other for csv file upload with term details.

* The 1st endpoint {glossary/template?fileType=csv} return template file this would be type of format of data that shows how the data needs to be populated by user in the file.

http://localhost:21000/api/atlas/v2/glossary/template?fileType=csv

Template structure:-

GlossaryName, TermName, ShortDescription, LongDescription, Examples, Abbreviation, Usage, AdditionalAttributes, TranslationTerms, ValidValuesFor, Synonyms, ReplacedBy, ValidValues, ReplacementTerms, SeeAlso, TranslatedTerms, IsA, Antonyms, Classifies, PreferredToTerms, PreferredTerms
Fruits,Apple5,SD4,LD4,"EXAMPLE","ABBREVIATION","USAGE",,"Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4","Footwear:B4"


* The 2nd endpoint {glossary/importGlossaryData} (file upload) would actually parse the Data into AtlasObjects and further create the AtlasGlossaryTerms inside Glossary.

curl -v -g POST -u admin:admin -H "Content-Type: multipart/form-data" -H "Cache-Control: no-cache" -F file=@template_6.csv "http://localhost:21000/api/atlas/v2/glossary/importGlossaryData"


Note:-

While populating the data in the  csv file each record should be maintained in single Line (enter command within the record would result in parsing the second line as a new record).

The downloaded template needs to be saved as whateverTheFileNameIs.csv explicitly.

If the file is been succefully uploaded then the AtlasGlossaryTerm would be returned or else List of Errors would returned for user to rectify them further.


Diffs (updated)
-----

  common/src/main/java/org/apache/atlas/repository/Constants.java 2f08efc 
  intg/src/main/java/org/apache/atlas/ApplicationProperties.java d3afd53 
  intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 9a1aa65 
  intg/src/main/java/org/apache/atlas/model/glossary/relations/AtlasGlossaryHeader.java 660514b 
  repository/pom.xml 802d587 
  repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java 9229d2d 
  repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java cdc3f07 
  repository/src/main/java/org/apache/atlas/glossary/GlossaryUtils.java 9625f94 
  repository/src/main/java/org/apache/atlas/util/CSVFileUtils.java PRE-CREATION 
  webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java 151aa6b 


Diff: https://reviews.apache.org/r/71482/diff/5/

Changes: https://reviews.apache.org/r/71482/diff/4-5/


Testing (updated)
-------

Tested both the endpoint with curl call.

Tested upload term csv with around 100 records from curl.


Thanks,

mayank jain