----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/71482/#review219988 -----------------------------------------------------------
repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java Lines 570 (patched) <https://reviews.apache.org/r/71482/#comment308221> Please remove these kind of extra blank lines from here as well all other places repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java Lines 649 (patched) <https://reviews.apache.org/r/71482/#comment308223> Do something like: Set ret = null; if (StringUtils.isNotBlank(csvRecord)) { ... ret = new HashSet(); ... } return ret; repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java Lines 672 (patched) <https://reviews.apache.org/r/71482/#comment308224> there is on extra space after system msg and then you are again doing + " ". Please remove one. Same is there at other places. please take care of this at all other locations repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java Lines 682 (patched) <https://reviews.apache.org/r/71482/#comment308222> you are already passing atlasGlossaryTerm as input to this function where you are using set of this object and then retunring the same object atlasGlossaryTerm and assigning it to same atlasGlossaryTerm at 573. Please revisit the design and rename the function accordingly. The function should always do one thing and should be named accordingly. Depending on that you should design the input and output arguments repository/src/main/java/org/apache/atlas/glossary/GlossaryTermUtils.java Lines 690 (patched) <https://reviews.apache.org/r/71482/#comment308225> Instead of \n use System.lineSeparator(). Please do this at all other places in entire patch repository/src/main/java/org/apache/atlas/util/FileUtils.java Lines 50 (patched) <https://reviews.apache.org/r/71482/#comment308226> Please call readCSV function directly instead of using class name as its in the same class repository/src/main/java/org/apache/atlas/util/FileUtils.java Lines 99 (patched) <https://reviews.apache.org/r/71482/#comment308227> Try to create a const for 0 explaining what does the position contains repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java Lines 960 (patched) <https://reviews.apache.org/r/71482/#comment308228> Please remove the extra space: assertEquals(e.getMessage(), "No Data found in the uploaded file!"); - Sidharth Mishra On March 13, 2020, 1 p.m., mayank jain wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/71482/ > ----------------------------------------------------------- > > (Updated March 13, 2020, 1 p.m.) > > > Review request for atlas, Ashutosh Mestry, keval bhatt, Madhan Neethiraj, > Nixon Rodrigues, and Sarath Subramanian. > > > Bugs: ATLAS-3423 > https://issues.apache.org/jira/browse/ATLAS-3423 > > > Repository: atlas > > > Description > ------- > > This patch consists implementation for 2 end points first for template > download and other for csv file upload with term details also the Unit Test > cases for both the end points. > > * The 1st endpoint {glossary/template} 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/importHeaderRow > > 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/import > > > 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 > ----- > > common/src/main/java/org/apache/atlas/repository/Constants.java 7c0fd56 > intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 1bd2fd0 > > intg/src/main/java/org/apache/atlas/model/glossary/relations/AtlasGlossaryHeader.java > 660514b > pom.xml a6da9b8 > 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/FileUtils.java PRE-CREATION > repository/src/test/java/org/apache/atlas/glossary/GlossaryServiceTest.java > 759dcdf > repository/src/test/resources/csvFiles/empty.csv PRE-CREATION > repository/src/test/resources/csvFiles/incorrectFile.csv PRE-CREATION > repository/src/test/resources/csvFiles/template_1.csv PRE-CREATION > repository/src/test/resources/excelFiles/template_1.xlsx PRE-CREATION > webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java 151aa6b > > > Diff: https://reviews.apache.org/r/71482/diff/18/ > > > Testing > ------- > > Tested both the endpoint with curl call. > > Tested upload term csv with around 100 records from curl. > > > Thanks, > > mayank jain > >
