xuzifu666 commented on code in PR #4422:
URL: https://github.com/apache/calcite/pull/4422#discussion_r2151543317
##########
core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java:
##########
@@ -1419,6 +1419,37 @@ public static boolean equalAsStructSansNullability(
return true;
}
+ /** Returns whether two types are equal, where two ROW types are considered
equal
+ * even if the field names differ. */
+ public static boolean equalUpToFieldNames(
+ RelDataType type1,
+ RelDataType type2) {
+ if (type1 == type2) {
+ return true;
+ }
+
+ if (type1.isStruct() != type2.isStruct()) {
+ return false;
+ }
+
+ if (!type1.isStruct()) {
Review Comment:
Put this line before ```if (type1.isStruct() != type2.isStruct())``` should
be better? it can reduce the calculation theoretically.
--
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]