alex-plekhanov commented on code in PR #4076:
URL: https://github.com/apache/calcite/pull/4076#discussion_r1870158420


##########
core/src/main/java/org/apache/calcite/rex/RexBuilder.java:
##########
@@ -1336,8 +1337,15 @@ protected RexLiteral makeLiteral(
       o = ((TimestampWithTimeZoneString) o).round(p);
       break;
     case DECIMAL:
-      if (o != null && type.getScale() != RelDataType.SCALE_NOT_SPECIFIED) {
-        assert o instanceof BigDecimal;
+      if (o == null) {
+        break;
+      }
+      assert o instanceof BigDecimal;
+      if (type instanceof IntervalSqlType) {
+        SqlIntervalQualifier qualifier = ((IntervalSqlType) 
type).getIntervalQualifier();
+        o = ((BigDecimal) o).multiply(qualifier.getUnit().multiplier);

Review Comment:
   There are no intervals less than SECONDS. Multiplier for seconds is 1000.



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