mihaibudiu commented on code in PR #4699:
URL: https://github.com/apache/calcite/pull/4699#discussion_r2636604415
##########
linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java:
##########
@@ -623,10 +620,37 @@ public static int compareLists(List<?> b0, List<?> b1) {
return Integer.compare(b0.size(), b1.size());
}
+ /**
+ * Compares two maps.
+ *
+ * <p>Since maps in Calcite are implemented using {@link
java.util.LinkedHashMap},
Review Comment:
there are two separate issues: the order of insertion in a MAP is not
defined (depending on how the map is created), and even if the order of
insertion is defined, the order of elements in a MAP is not defined for
comparisons.
For the tested implementation both may be deterministic, but we have to be
careful to explain that these orders may not be the same as in other
implementations. Maybe that's all that's required: add a comment that for
linkedhashmap the order is deterministic.
--
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]