This is an automated email from the ASF dual-hosted git repository.
jakevin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 64ea450ac72 [enhancement](Nereids): add Unit Test for
PushdownTopNThroughJoin (#26447)
64ea450ac72 is described below
commit 64ea450ac72f72d3e72aec3652e709ad8e640547
Author: jakevin <[email protected]>
AuthorDate: Mon Nov 6 16:54:36 2023 +0800
[enhancement](Nereids): add Unit Test for PushdownTopNThroughJoin (#26447)
---
.../rules/rewrite/PushdownTopNThroughJoinTest.java | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushdownTopNThroughJoinTest.java
b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushdownTopNThroughJoinTest.java
index c033ca46bc9..8532f119298 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushdownTopNThroughJoinTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushdownTopNThroughJoinTest.java
@@ -131,6 +131,32 @@ class PushdownTopNThroughJoinTest extends
TestWithFeService implements MemoPatte
);
}
+ @Test
+ void testTwoJoinSql() {
+ PlanChecker.from(connectContext)
+ .analyze(
+ "SELECT\n"
+ + " V.*\n"
+ + "FROM\n"
+ + " (\n"
+ + " SELECT t1.*\n"
+ + " FROM t1 LEFT JOIN t1 t2 ON t1.k1 =
t2.k1\n"
+ + " WHERE t1.k2 >= 20221001 AND t2.k2 = 1\n"
+ + " ORDER BY t1.k2 ASC LIMIT 10\n"
+ + " ) V\n"
+ + " LEFT JOIN t1 O ON V.k1 = O.k1\n"
+ + "ORDER BY k2 ASC LIMIT 10;")
+ .rewrite()
+ .matches(
+ logicalJoin(
+ logicalTopN(
+ logicalProject(logicalJoin())
+ ),
+ logicalProject(logicalOlapScan())
+ )
+ );
+ }
+
@Test
void testProjectSql() {
PlanChecker.from(connectContext)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]