somu-imply commented on code in PR #13799:
URL: https://github.com/apache/druid/pull/13799#discussion_r1116359795
##########
processing/src/main/java/org/apache/druid/segment/UnnestColumnValueSelectorCursor.java:
##########
@@ -243,9 +245,23 @@ public void advance()
@Override
public void advanceUninterruptibly()
{
- do {
+ // the index currently points to an element at position i ($e_i)
+ // while $e_i does not match the filter
+ // keep advancing the pointer to the first valid match
+ // calling advanceAndUpdate increments the index position so needs a call
to matches() again for new match status
+ boolean match = valueMatcher.matches();
+ if (match) {
advanceAndUpdate();
- } while (matchAndProceed());
+ match = valueMatcher.matches();
+ }
+ while (!match) {
+ if (!baseCursor.isDone()) {
+ advanceAndUpdate();
+ match = valueMatcher.matches();
+ } else {
+ return;
+ }
+ }
Review Comment:
Thanks this should be
```
while (true) {
advanceAndUpdate();
boolean match = valueMatcher.matches();
if (match || baseCursor.isDone()) {
return;
}
}
```
The match changes after the update so the call should be below. I'll add it
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]