mihaibudiu commented on code in PR #4402:
URL: https://github.com/apache/calcite/pull/4402#discussion_r2112420968
##########
core/src/main/java/org/apache/calcite/rex/RexUtil.java:
##########
@@ -218,6 +218,17 @@ public static boolean isNull(RexNode expr) {
}
}
+ public static boolean isCollectionValueConstructorWithoutAnyCast(
Review Comment:
this can be implemented by white-listing operations that are known to have
no side-effects, and assuming that all other operations do.
For example, collection constructors are safe if all arguments are safe.
Some casts are safe: the ones that cast from a narrow value to a wider one
(there is a function to check that).
Moreover, comparisons are safe. Arithmetic will be safe if the type system
does not require checked arithmetic.
Having such a utility function will prove useful in many other circumstances.
--
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]