twdsilva commented on code in PR #2876: URL: https://github.com/apache/calcite/pull/2876#discussion_r1038665246
########## core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java: ########## @@ -1252,6 +1285,193 @@ protected RexNode replaceWithOriginalReferences(final RexBuilder rexBuilder, } } + /** + * Used to generate a view predicate that is added to a materialized view that aggregates + * over a FLOOR(datetime) when the query has a range predicate on the same column. + */ + static class ImplicitViewPredicateShuttle extends RexShuttle { + + private final RexBuilder rexBuilder; + private final RexCall floorCall; + private final RexInputRef rexInputRef; + private final boolean generateViewFilter; + private long lowerBound; + private long upperBound; + + ImplicitViewPredicateShuttle(RexBuilder rexBuilder, RexCall floorCall, + RexInputRef rexInputRef, + boolean generateViewFilter) { + this.floorCall = floorCall; + this.rexBuilder = rexBuilder; + this.rexInputRef = rexInputRef; + this.generateViewFilter = generateViewFilter; + } + + private RexNode transformCall(RexCall call, boolean isLowerBound) { Review Comment: added a method `transformCallHelper`. -- 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: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org