darpan-14 commented on code in PR #5251:
URL: https://github.com/apache/calcite/pull/5251#discussion_r3976842855
##########
core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java:
##########
@@ -482,6 +552,10 @@ RexNode compareExtract(SqlKind comparison, RexNode operand,
c = (Calendar) r.lowerEndpoint().clone();
int i = 0;
while (next(c, timeUnit, v, r, i++ > 0)) {
+ if (!rangeExpansionLimiter.tryAddRange()) {
+ rangeExpansionLimiter.reset(rangeCountMark);
Review Comment:
Apologies, I misunderstood the question.
rangeCountMark captures the count before the current compareExtract call. So
when we rest to rangeCountMark, we just undo the changes made in current
compareExtract call while preserving the counter value due to previously done
work.
--
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]