lionants02 opened a new issue, #7263: URL: https://github.com/apache/hop/issues/7263
### Apache Hop version? 2.18.0 ### Java version? OpenJDK Runtime Environment (build 21.0.2+13-58) OpenJDK 64-Bit Server VM (build 21.0.2+13-58, mixed mode, sharing) ### Operating system Windows ### What happened? ### Description When running a pipeline in Apache Hop 2.18.0, the `Sorted merge` transform throws an `IndexOutOfBoundsException` if the preceding transform (`Sort rows`) is configured to run with multiple copies (e.g., `x8`). The internal array or list managing the incoming rowsets (`inputRowSets`) does not seem to handle multiple incoming parallel streams properly during the first row retrieval phase (`getRowSortedFirstCall`), leading to a crash when trying to access index 7 when the list length is only 1. ### Environment - **Apache Hop version:** 2.18.0 - **Execution Engine:** Local Pipeline Engine - **Java Version:** OpenJDK Runtime Environment (build 21.0.2+13-58) OpenJDK 64-Bit Server VM (build 21.0.2+13-58, mixed mode, sharing) - **OS:** Windows11 ### Steps to Reproduce 1. Create a pipeline with the following sequence: `Generate rows` -> `Cluset generate` -> `Sort rows` -> `Sorted merge`. 2. Configure `Generate rows`, `Cluset generate`, and `Sort rows` to run with **8 copies** (`x8`). 3. Keep the `Sorted merge` transform at the default **1 copy**. 4. Execute the pipeline using the Local Pipeline Engine. 5. The pipeline will immediately crash at the `Sorted merge` transform block. ### Expected Behavior The `Sorted merge` transform should dynamically discover and allocate row sets for all 8 incoming parallel streams from the previous `Sort rows` transform copies, then successfully merge them in sorted order without throwing an index bounds error. ### Actual Behavior The pipeline fails instantly with: `java.lang.IndexOutOfBoundsException: Index 7 out of bounds for length 1` at `org.apache.hop.pipeline.transforms.sortedmerge.SortedMerge.getRowSortedFirstCall(SortedMerge.java:145)` ### Screenshots <img width="1631" height="802" alt="Image" src="https://github.com/user-attachments/assets/2676cd0c-1aff-44cf-ace6-60ad487693e4" /> ### Log Output ```text 2026/06/11 13:29:58 [Basic] Hop - Pipeline opened. 2026/06/11 13:29:58 [Basic] Hop - Launching pipeline [sortmerge]... 2026/06/11 13:29:58 [Basic] Hop - Started executing pipeline 'sortmerge'. 2026/06/11 13:29:58 [Basic] sortmerge - Executing this pipeline using the Local Pipeline Engine with run configuration 'local' 2026/06/11 13:29:58 [Basic] sortmerge - Execution started for pipeline [sortmerge] 2026/06/11 13:29:58 [Basic] Generate rows.1 - Finished processing (I=0, O=0, R=0, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Generate rows.0 - Finished processing (I=0, O=0, R=0, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Generate rows.2 - Finished processing (I=0, O=0, R=0, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Generate rows.3 - Finished processing (I=0, O=0, R=0, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Generate rows.5 - Finished processing (I=0, O=0, R=0, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Generate rows.4 - Finished processing (I=0, O=0, R=0, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Generate rows.6 - Finished processing (I=0, O=0, R=0, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Generate rows.7 - Finished processing (I=0, O=0, R=0, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Cluset generate.2 - Finished processing (I=0, O=0, R=10000, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Cluset generate.3 - Finished processing (I=0, O=0, R=10000, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Cluset generate.1 - Finished processing (I=0, O=0, R=10000, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Cluset generate.0 - Finished processing (I=0, O=0, R=10000, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Cluset generate.6 - Finished processing (I=0, O=0, R=10000, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Cluset generate.4 - Finished processing (I=0, O=0, R=10000, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Cluset generate.7 - Finished processing (I=0, O=0, R=10000, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Basic] Cluset generate.5 - Finished processing (I=0, O=0, R=10000, W=10000, U=0, E=0) 2026/06/11 13:29:58 [Error] Sorted merge.0 - Unexpected error 2026/06/11 13:29:58 [Error] Sorted merge.0 - java.lang.IndexOutOfBoundsException: Index 7 out of bounds for length 1 2026/06/11 13:29:58 [Error] Sorted merge.0 - at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at java.base/java.util.Objects.checkIndex(Objects.java:385) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at java.base/java.util.ArrayList.get(ArrayList.java:427) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at org.apache.hop.pipeline.transforms.sortedmerge.SortedMerge.getRowSortedFirstCall(SortedMerge.java:145) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at org.apache.hop.pipeline.transforms.sortedmerge.SortedMerge.getRowSorted(SortedMerge.java:60) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at org.apache.hop.pipeline.transforms.sortedmerge.SortedMerge.processRow(SortedMerge.java:180) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at org.apache.hop.pipeline.transform.RunThread.run(RunThread.java:54) 2026/06/11 13:29:58 [Error] Sorted merge.0 - at java.base/java.lang.Thread.run(Thread.java:1583) 2026/06/11 13:29:58 [Basic] Hop - Stopped processing pipeline 'sortmerge'. 2026/06/11 13:29:58 [Basic] Sort rows.6 - Finished processing (I=0, O=0, R=10000, W=9904, U=0, E=0) 2026/06/11 13:29:58 [Basic] Sort rows.7 - Finished processing (I=0, O=0, R=10000, W=9906, U=0, E=0) 2026/06/11 13:29:58 [Basic] Sort rows.0 - Finished processing (I=0, O=0, R=10000, W=9901, U=0, E=0) 2026/06/11 13:29:58 [Basic] Sort rows.2 - Finished processing (I=0, O=0, R=10000, W=9917, U=0, E=0) 2026/06/11 13:29:58 [Basic] Sort rows.4 - Finished processing (I=0, O=0, R=10000, W=9904, U=0, E=0) 2026/06/11 13:29:58 [Basic] Sorted merge.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1) 2026/06/11 13:29:58 [Basic] Sort rows.5 - Finished processing (I=0, O=0, R=10000, W=0, U=0, E=0) 2026/06/11 13:29:58 [Basic] Sort rows.3 - Finished processing (I=0, O=0, R=10000, W=0, U=0, E=0) 2026/06/11 13:29:58 [Basic] Sort rows.1 - Finished processing (I=0, O=0, R=10000, W=0, U=0, E=0) 2026/06/11 13:29:58 [Minimal] sortmerge - Pipeline detected one or more transforms with errors. 2026/06/11 13:29:58 [Minimal] sortmerge - Pipeline is killing the other transforms! 2026/06/11 13:29:58 [Basic] sortmerge - Pipeline duration : 0.231 seconds [ 0.231" ] 2026/06/11 13:29:58 [Basic] Hop - Pipeline 'sortmerge' completed. 2026/06/11 13:29:58 [Basic] sortmerge - Execution finished on a local pipeline engine with run configuration 'local' ``` ### Issue Priority Priority: 2 ### 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]
