leehaut opened a new pull request, #9082:
URL: https://github.com/apache/hop/pull/9082

   Fix https://github.com/apache/hop/issues/9041
   
   YAML Input stopped after the first element of a list of maps, and threw a 
NullPointerException when a field path matched nothing or when every file was 
empty and "Ignore empty file" was selected. Labels and tooltips for that 
transform also described the wrong behavior.
   
   A list of maps is now read to the end. `$.id` and `$[*].id` both return one 
row per element. A missing path becomes a null field instead of failing the 
transform. Skipping empty files walks the file list and finishes normally when 
nothing remains to read. English and Chinese labels now match this behavior: 
the result-files label says "filenames", the row-number field is an Integer, 
and the Required and Ignore empty file tooltips no longer describe wildcard 
handling or empty files incorrectly.
   
   The existing YAML integration tests cover map documents, wildcard paths on a 
map, plain value lists, multiple documents, and YAML stored in a field. Those 
paths are unchanged. New unit tests cover a list of maps, a missing path, a 
single empty file, and an empty file followed by a file with content.
   
   ## Verification
   
   Ran the three pipelines with the Local Pipeline Engine:
   
   - `list-of-maps`: a list of maps returns Anna, Ben, and Chris (3 rows, 0 
errors). A plain list still returns Spark, Flink, and Beam (3 rows, 0 errors).
   - `missing-path`: `$.nope` returns one row, `id = 1` and `missing = null`, 
and the pipeline finishes with 0 errors.
   - `ignore-empty-file`: the only file is empty and "Ignore empty file" is 
selected. The log reports that the file is empty, no rows are written, and the 
pipeline finishes with no error.
   
   ## Unit tests
   
   `YamlReaderTests` covers a list of maps with `$.id` / `$.name` and with 
`$[*].id` / `$[*].name`, and a missing path that becomes null.
   
   `YamlInputTests` covers the same list of maps and missing path through 
`processRow`, plus "Ignore empty file" for one empty file and for an empty file 
followed by a file with rows.
   
   
   


-- 
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]

Reply via email to