asolimando commented on code in PR #4557:
URL: https://github.com/apache/calcite/pull/4557#discussion_r2381616831
##########
core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java:
##########
@@ -556,6 +557,96 @@ 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)
+ public static boolean integerRangeContains(RelDataType container,
+ RelDataType content) {
+ checkArgument(isIntType(container),
+ "container must be an integer type: %s", container);
+
+ final SqlTypeName contentType = content.getSqlTypeName();
+ if (contentType == null) {
Review Comment:
No, it's not, Sonarlint highlighted that locally but SonarCloud didn't catch
it, weird. It's fixed now, thanks!
--
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]