hansva commented on code in PR #9529:
URL: https://github.com/apache/hop/pull/9529#discussion_r4597334317


##########
plugins/transforms/sortedmerge/src/main/java/org/apache/hop/pipeline/transforms/sortedmerge/SortedMerge.java:
##########
@@ -160,10 +164,12 @@ private void getRowSortedFirstCall() throws 
HopTransformException {
         }
       }
 
+      // Compare with the metadata that carries the merge settings: the 
metadata of the rows only
+      // says how they are sorted when the transform before this one says so
       data.comparator =
           (o1, o2) -> {
             try {
-              return o1.getRowMeta().compare(o1.getRowData(), o2.getRowData(), 
data.fieldIndices);
+              return data.rowMeta.compare(o1.getRowData(), o2.getRowData(), 
data.fieldIndices);

Review Comment:
   Main never used the Ascending setting to compare rows: the flag went onto 
data.rowMeta, but the comparator used each input's own metadata. Sort rows 
(descending) into Ascending = Y only gave descending output because the setting 
was ignored. #9528 lists descending merges from Sort rows as working, and that 
is Ascending = N, which still works. Letting the input's flag override Y but 
not N would make the rule depend on the direction, and Ascending = N with 
ascending input would still stop. So the setting stays authoritative. A 
contradicting setup now stops with an error that names the field, and Verify 
warns about it. These setups come from Get fields, which always filled in Y; it 
now copies the direction from the previous transform. I'll note the change in 
behaviour in the release notes.



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