xiedeyantu commented on code in PR #4699:
URL: https://github.com/apache/calcite/pull/4699#discussion_r2636601104
##########
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:
Semantically, SQL is indeed nondeterministic, but in the current
implementation of Calcite, it is deterministic. So I understand that executing
"SELECT MAP(SELECT a, b FROM x)" multiple times yields consistent results,
which also explains why the test cases with SQL queries lacking
"ORDER BY" can still run stably. However, this is admittedly not rigorous.
So, are you leaning towards sorting before comparison? Although this is
inconsistent with DuckDB's behavior, it is justifiable. Perhaps other databases
do the same, and I just haven't noticed it yet. What do you think is the better
approach for me to choose?
(P.S.: There is currently an issue, though unrelated to our discussion, that
I will also need to fix later.)
--
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]