apache / hop

Hop Orchestration Platform
https://hop.apache.org/
Apache License 2.0
985 stars 354 forks source link

[Bug]: CSVImport ends on first file that contains no content after the header when using "Header row present?" #4561

Open jjjcck opened 1 week ago

jjjcck commented 1 week ago

Apache Hop version?

2.10

Java version?

17

Operating system

Windows

What happened?

Just as in CsvInput.java from Pe..t.... 9 the CSVInput ends the stream as soon as it finds a file without data after the header.

Example: Create fileH.csv with only a header row Create fileC.csv with header row and one content row Create ktr-file which has a stream with the two filename, which are then put into the CSVInput Step so it will read the content of the file. Set "Header row present?" to true for the CSVInput-Step. Current faulty result: No rows will be in the output of the CSVInput Step Expected result: The content of fileC.csv should be in the output of the step.

Could if (data.fieldsMapping.size() == 0) { return false; in openNextFile() in hop/plugins/transforms/textfile/src/main/java/org/apache/hop/pipeline/transforms/csvinput be the problem?

PS: In Pen.t... 6 this was no problem.

Issue Priority

Priority: 3

Issue Component

Component: Transforms