vlsi commented on code in PR #3395:
URL: https://github.com/apache/calcite/pull/3395#discussion_r1332562309


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java:
##########
@@ -973,6 +973,9 @@ private static Expression scaleIntervalToNumber(
       RelDataType sourceType,
       RelDataType targetType,
       Expression operand) {
+    if (targetType.getSqlTypeName().getFamily() == null) {
+      return operand;
+    }
     switch (requireNonNull(targetType.getSqlTypeName().getFamily(),
         () -> "SqlTypeFamily for " + targetType)) {

Review Comment:
   Please rework, and remove code duplication.
   Extract `family` into a regular variable, and perform a regular null check. 
Then `requireNonNull` will not be needed.
   
   Thank you so much for doing so.



-- 
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]

Reply via email to