zstan commented on code in PR #13467:
URL: https://github.com/apache/ignite/pull/13467#discussion_r3802074778
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/LogicalRelImplementor.java:
##########
@@ -1084,7 +1085,10 @@ private long validateAndGetFetchOffsetParams(RexNode
node, String op) {
if (paramAsDecimal.signum() < 0)
throw new IllegalArgumentException("Negative value for " + op);
- return IgniteMath.convertToLongExact(paramAsDecimal,
RoundingMode.DOWN);
+ IgniteSqlPaginationPolicy pagPlc =
ctx.unwrap(IgniteSqlPaginationPolicy.class);
Review Comment:
let\`s add `@Nullable` to PlanningContext#unwrap ?
Probably it would be clear to unify this code and the equal from
IgniteSqlValidator#checkLimitOffset ->
a mean this :
```
RoundingMode roundingMode = pagPlc == null ?
IgniteMath.NUMERIC_ROUNDING_MODE : pagPlc.roundingMode();
IgniteMath.convertToLongExact(val, roundingMode);
```
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgnitePlanner.java:
##########
@@ -423,19 +424,10 @@ public String dump() {
return w.toString();
}
- /** Returns whether the SELECT changes row cardinality using aggregation.
*/
- @SuppressWarnings("deprecation")
- public boolean isAggregate(SqlSelect select, @Nullable SqlNodeList
orderList) {
- SqlValidator validator = validator();
-
- return validator.isAggregate(select)
- || (orderList != null && validator.isAggregate(orderList));
- }
-
/** */
private SqlValidator validator() {
if (validator == null)
- validator = new IgniteSqlValidator(operatorTbl, catalogReader,
typeFactory, validatorCfg, ctx.parameters());
+ validator = createSqlValidator(catalogReader);
Review Comment:
I understand that it\`s all about code unification - but nethertheless it`\s
strange to pass already existing 'catalogReader' here.
--
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]