chunweilei commented on a change in pull request #1710: [CALCITE-2672]
Qualifying the common column should not be allowed in Oracle dialect
URL: https://github.com/apache/calcite/pull/1710#discussion_r362171951
##########
File path: core/src/main/java/org/apache/calcite/rex/RexBuilder.java
##########
@@ -669,16 +669,9 @@ private RexNode makeCastIntervalToExact(RelDataType
toType, RexNode exp) {
final TimeUnit endUnit = exp.getType().getSqlTypeName().getEndUnit();
final TimeUnit baseUnit = baseUnit(exp.getType().getSqlTypeName());
final BigDecimal multiplier = baseUnit.multiplier;
- final int scale = 0;
- BigDecimal divider = endUnit.multiplier.scaleByPowerOfTen(-scale);
+ final BigDecimal divider = endUnit.multiplier;
RexNode value = multiplyDivide(decodeIntervalOrDecimal(exp),
multiplier, divider);
- if (scale > 0) {
- RelDataType decimalType =
- typeFactory.createSqlType(SqlTypeName.DECIMAL,
- scale + exp.getType().getPrecision(), scale);
- value = encodeIntervalOrDecimal(value, decimalType, false);
- }
return ensureType(toType, value, false);
Review comment:
Dead codes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services