zstan commented on code in PR #13375:
URL: https://github.com/apache/ignite/pull/13375#discussion_r3734864586
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/LogicalRelImplementor.java:
##########
@@ -1076,21 +1077,18 @@ private long validateAndGetFetchOffsetParams(RexNode
node, String op) {
IgniteQueryErrorCode.UNEXPECTED_ELEMENT_TYPE);
}
- long paramAsLong;
-
try {
- paramAsLong = IgniteMath.convertToLongExact((Number)param);
+ BigDecimal paramAsDecimal =
IgniteMath.convertToBigDecimal((Number)param);
+
+ if (paramAsDecimal.signum() < 0) {
+ throw new IllegalArgumentException("Negative value of " + op);
Review Comment:
We already have correct message for such a case, why do you use additional
one ?
```
throw new
IgniteSQLException(IgniteResource.INSTANCE.illegalFetchLimit(op).str(),
IgniteQueryErrorCode.UNEXPECTED_ELEMENT_TYPE);
```
--
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]