JackieTien97 commented on code in PR #14755:
URL: https://github.com/apache/iotdb/pull/14755#discussion_r1928152667
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/TableMetadataImpl.java:
##########
@@ -884,6 +894,28 @@ public static boolean isTwoTypeComparable(List<? extends
Type> argumentTypes) {
|| ((isNumericType(left) || isCharType(left)) && isUnknownType(right));
}
+ public static boolean areAllTypesSameAndComparable(List<? extends Type>
argumentTypes) {
+ if (argumentTypes == null || argumentTypes.isEmpty()) {
+ return true;
+ }
+ Type firstType = argumentTypes.get(0);
+ if (!firstType.isComparable()) {
+ return false;
+ }
+ return argumentTypes.stream().allMatch(type -> type.equals(firstType));
+ }
+
+ public static boolean isAllTypeComparable(List<? extends Type>
argumentTypes) {
+ Type firstType = argumentTypes.get(0);
+ boolean flag = true;
+ for (Type type : argumentTypes) {
+ if (!isTwoTypeComparable(Arrays.asList(firstType, type))) {
+ flag = false;
+ }
+ }
+ return flag;
+ }
+
Review Comment:
```suggestion
```
--
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]