Adalennis opened a new issue, #9041:
URL: https://github.com/apache/hop/issues/9041
### Apache Hop version?
2.20.0-SNAPSHOT
### Java version?
Hava 21
### Operating system
macOS
### What happened?
Found while documenting YAML Input (#2367). All cases reproduced with
hop-run on the current main.
**1. A document that is a list of maps only gives its first element.**
```yaml
- id: 1
name: Anna
- id: 2
name: Ben
- id: 3
name: Chris
```
Fields with paths `$.id` and `$.name` (or `$[*].id` and `$[*].name`, which
is what Get fields proposes) give 1 row instead of 3.
`YamlReader.processMapRow` calls `finishDocument()` once the rows of the first
element are sent. A list of plain values (`- Spark`, `- Flink`) works.
**2. A path that finds nothing fails with a NullPointerException.**
A field with path `$.nope` on any map document stops the transform.
`YamlReader.readPathAsList` and `toValueList` return `List.of((Object) null)`,
and `List.of` doesn't accept null.
**3. "Ignore empty file" fails with a NullPointerException when every file
is empty.**
With one empty file, or a folder of empty files: `Cannot invoke
"YamlReader.getRow(...)" because "this.data.yaml" is null`. In
`YamlInput.openNextFile` the recursive call for the next file returns false,
but the outer call returns true. Without the option, empty files give no rows
and no error. An empty file followed by a file with content also works.
**4. Labels and tooltips:**
- "Add files to result filesname" has a typo ("filenames").
- The "Rownum in output" tooltip says the field is a String; it is an
Integer.
- The "Required" tooltip says "Only used for files without wildcards", but
for a folder with a regular expression the transform also fails when the folder
doesn't exist or no file matches.
- The "Ignore empty file" tooltip says Hop fails otherwise, but empty files
give no rows and no error without the option.
### Issue Priority
Priority: 3
### Issue Component
Component: Hop Gui
--
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]