xiedeyantu commented on code in PR #4233:
URL: https://github.com/apache/calcite/pull/4233#discussion_r1986501939
##########
core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java:
##########
@@ -574,6 +574,45 @@ private static boolean skipItem(RexNode expr) {
.check();
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6878">[CALCITE-6878]
+ * Add the planner rule that pushes the Filter past a Sort</a>. */
+ @Test void testFilterSortTranspose() {
+ final Function<RelBuilder, RelNode> relFn = b -> b
+ .scan("EMP")
+ .project(b.field(0))
+ .sort(b.field(0))
+ .filter(b.lessThan(b.field(0), b.literal(10)))
+ .build();
+ relFn(relFn).withRule(CoreRules.FILTER_SORT_TRANSPOSE).check();
+ }
+
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6878">[CALCITE-6878]
+ * Add the planner rule that pushes the Filter past a Sort</a>. */
+ @Test void testFilterSortTransposeFetch() {
+ final Function<RelBuilder, RelNode> relFn = b -> b
+ .scan("EMP")
+ .project(b.field(0))
+ .sortLimit(0, 1, b.field(0))
+ .filter(b.lessThan(b.field(0), b.literal(10)))
+ .build();
+ relFn(relFn).withRule(CoreRules.FILTER_SORT_TRANSPOSE).checkUnchanged();
+ }
+
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6878">[CALCITE-6878]
+ * Add the planner rule that pushes the Filter past a Sort</a>. */
Review Comment:
> Please ensure the Java documentation is precisely the same as the Jira
title.
OK, thanks.
--
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]