mihaibudiu commented on code in PR #4707:
URL: https://github.com/apache/calcite/pull/4707#discussion_r2648755450
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdMaxRowCount.java:
##########
@@ -115,11 +117,10 @@ public Double getMaxRowCount(Sort rel, RelMetadataQuery
mq) {
rowCount = Double.POSITIVE_INFINITY;
}
- final long offset = rel.offset instanceof RexLiteral ?
RexLiteral.longValue(rel.offset) : 0;
+ final double offset = literalNumericValue(rel.offset, 0D);
Review Comment:
if long overflows, so does double, but the error handling is different: long
will throw, but double will approximate.
Just make it clear what is happening.
--
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]