tkalkirill commented on code in PR #13464:
URL: https://github.com/apache/ignite/pull/13464#discussion_r3765996375
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/SortConverterRule.java:
##########
@@ -74,13 +84,15 @@ public interface Config extends RelRule.Config {
sort.fetch));
}
else {
+ boolean pushLimit = canPushLimit(sort);
+
RelNode igniteSort = new IgniteSort(
cluster,
cluster.traitSetOf(IgniteConvention.INSTANCE).replace(sort.getCollation()),
convert(sort.getInput(),
cluster.traitSetOf(IgniteConvention.INSTANCE)),
sort.getCollation(),
- sort.offset,
- sort.fetch,
+ pushLimit ? sort.offset : null,
Review Comment:
`pushLimit` only controls the optional local Top-N optimization in
`IgniteSort`. The original offset and fetch are always preserved in the outer
`IgniteLimit`. When pushdown is disabled, `IgniteSort` sorts the complete
input, and the outer single-distribution `IgniteLimit` is converted to
`LimitNode`, which evaluates and applies the original expressions.
--
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]