mattcasters opened a new pull request, #8524: URL: https://github.com/apache/hop/pull/8524
Fixes #8404. Get Fields on Text File Input and CSV File Input share `TextFileCSVImportProgressDialog`. Sampling a file derived the types, lengths and masks, then closed the progress dialog before that result was published. The fields grid kept the header names, with a blank first row. On a remote CSV the scan also resolved the file on every sample line. - Publish the scan result before the progress dialog closes, then copy type, mask, length and precision onto the grid. Integer columns get precision 0, because the guess leaves -1 and the grid hides that. - Resolve the sample file and the row layout once. - Skip blank lines when Text File Input has "No empty lines" set, and do not count them toward the sample size. Unix mode on a CRLF file produces one after every row. - Build the summary from `StringEvaluator` instead of the unused date-format sentinels (year 2199 / 1900). - Drop the placeholder row `removeAll` leaves behind. `TextFileCsvImportScanTest` covers a CRLF customers file: one file resolve, the first data row for DOS, Unix and mixed, the Integer mask ` #` with length 15 and precision 0, the date mask `yyyy/MM/dd`, and a missing file failing once. CSV Input still samples local files only. It uses the same dialog, so Get Fields there gets the same result. ## Test `./mvnw -pl plugins/transforms/textfile -am test -Dtest=TextFileCsvImportScanTest -Dsurefire.failIfNoSpecifiedTests=false` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
