asolimando commented on code in PR #4557:
URL: https://github.com/apache/calcite/pull/4557#discussion_r2383260213
##########
core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java:
##########
@@ -556,6 +557,87 @@ public static boolean isExactNumeric(RelDataType type) {
}
}
+ /**
+ * Returns whether {@code container} can represent every value produced by
+ * {@code content} without loss of information.
+ *
+ * <p>The {@code container} type must be one of the integer types (signed or
+ * unsigned). The {@code content} type can be integer, or a DECIMAL with
+ * scale {@code 0}. For all other types this method returns {@code false}.
+ *
+ * @throws IllegalArgumentException if {@code container} is not an integer
type
+ */
+ @API(since = "1.40", status = API.Status.EXPERIMENTAL)
Review Comment:
That's an interesting point, we probably want to keep both experimental or
stable.
To me experimental is really about breaking the contract without waiting for
a new major version, but here the only relevant contrat is that the
`isLosslessCast` method is sound but not necessarily complete, and we will ever
want to make it unsound on purpose.
The new method seems reasonably complete and I don't see it changing
existing behavior unless we find a bug.
All considered, we could promote both to Stable, WDYT?
--
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]