mihaibudiu commented on code in PR #4707:
URL: https://github.com/apache/calcite/pull/4707#discussion_r2648746593


##########
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:
   Pragmatically it is very unlikely that the code will deal with collections 
with more than 2^53 values.
   Most metadata information is approximate anyway, counting on exact 
comparisons would be wrong.
   But this should de considered independently for every kind of metadata.
   (As a side note, in some computation modes which deal with multisets it is 
possible for multisets to have many copies of an element, exceeding 2^53 
elements in a collection. In our implementation all sets are represented this 
way.)



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