mihaibudiu commented on code in PR #3663:
URL: https://github.com/apache/calcite/pull/3663#discussion_r1772060274
##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -1498,7 +1498,7 @@ public static SqlNode toSql(RexLiteral literal) {
case EXACT_NUMERIC: {
if (SqlTypeName.APPROX_TYPES.contains(typeName)) {
return SqlLiteral.createApproxNumeric(
- castNonNull(literal.getValueAs(BigDecimal.class)).toPlainString(),
POS);
+ castNonNull(literal.getValueAs(Double.class)).toString(), POS);
Review Comment:
BigDecimal.class should still be a legal argument for this function.
There are a few places in the code where this happens.
This code assumes only that the createApproxNumeric will correctly handle
Java string representations of double values.
--
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]