alex-plekhanov commented on code in PR #11613:
URL: https://github.com/apache/ignite/pull/11613#discussion_r1816170184
##########
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/AbstractReducer.java:
##########
@@ -319,20 +320,23 @@ protected final ReduceResultPage
createDummyLastPage(ReduceResultPage lastPage)
* @param iter Current iterator.
* @return The same or new iterator.
*/
- protected final Iterator<Value[]>
pollNextIterator(Pollable<ReduceResultPage> queue, Iterator<Value[]> iter) {
- if (!iter.hasNext()) {
+ protected final IgniteIntObjectTuple<Iterator<Value[]>> pollNextIterator(
+ Pollable<ReduceResultPage> queue,
+ IgniteIntObjectTuple<Iterator<Value[]>> iter
+ ) {
+ if (!iter.get2().hasNext()) {
try (TraceSurroundings ignored =
MTC.support(ctx.tracing().create(SQL_PAGE_FETCH, MTC.span()))) {
ReduceResultPage page = takeNextPage(queue);
if (!page.isLast())
page.fetchNextPage(); // Failed will throw an exception
here.
- iter = page.rows();
+ iter = F.intt(page.columnCount(), page.rows());
Review Comment:
This field is accessed only when `iter.hsNext()` returns `true`. You can
store first non-zero value.
--
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]