diff --git a/core/trino-main/src/test/java/io/trino/sql/planner/AbstractPredicatePushdownTest.java b/core/trino-main/src/test/java/io/trino/sql/planner/AbstractPredicatePushdownTest.java index 5fb02b62ae8f7..476b697ffc14f 100644 --- a/core/trino-main/src/test/java/io/trino/sql/planner/AbstractPredicatePushdownTest.java +++ b/core/trino-main/src/test/java/io/trino/sql/planner/AbstractPredicatePushdownTest.java @@ -486,12 +486,12 @@ public void testSimplifyNonInferrableInheritedPredicate() @Test public void testDoesNotCreatePredicateFromInferredPredicate() { - assertPlan("SELECT * FROM (SELECT *, nationkey + 1 as nationkey2 FROM nation) a JOIN nation b ON a.nationkey = b.nationkey", + assertPlan("SELECT * FROM (SELECT *, nationkey + 1 as nationkey2 FROM nation) a JOIN nation b ON a.nationkey2 = b.nationkey", output( join(INNER, builder -> builder - .equiCriteria("L_NATIONKEY", "R_NATIONKEY") + .equiCriteria("L_NATIONKEY2", "R_NATIONKEY") .left( - filter("true", // DF filter + project(ImmutableMap.of("L_NATIONKEY2", expression("L_NATIONKEY + BIGINT '1'")), tableScan("nation", ImmutableMap.of("L_NATIONKEY", "nationkey")))) .right( anyTree( diff --git a/core/trino-main/src/test/java/io/trino/sql/planner/TestPredicatePushdownWithoutDynamicFilter.java b/core/trino-main/src/test/java/io/trino/sql/planner/TestPredicatePushdownWithoutDynamicFilter.java index 92fa340168ef6..1c4e627e47429 100644 --- a/core/trino-main/src/test/java/io/trino/sql/planner/TestPredicatePushdownWithoutDynamicFilter.java +++ b/core/trino-main/src/test/java/io/trino/sql/planner/TestPredicatePushdownWithoutDynamicFilter.java @@ -13,7 +13,6 @@ */ package io.trino.sql.planner; -import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import io.trino.Session; import io.trino.sql.planner.plan.ExchangeNode; @@ -24,7 +23,6 @@ import static io.trino.sql.planner.assertions.PlanMatchPattern.filter; import static io.trino.sql.planner.assertions.PlanMatchPattern.join; import static io.trino.sql.planner.assertions.PlanMatchPattern.node; -import static io.trino.sql.planner.assertions.PlanMatchPattern.output; import static io.trino.sql.planner.assertions.PlanMatchPattern.project; import static io.trino.sql.planner.assertions.PlanMatchPattern.semiJoin; import static io.trino.sql.planner.assertions.PlanMatchPattern.tableScan; @@ -175,31 +173,4 @@ public void testNonStraddlingJoinExpression() anyTree( tableScan("orders", ImmutableMap.of("ORDERS_OK", "orderkey"))))))); } - - @Override - @Test - public void testDoesNotCreatePredicateFromInferredPredicate() - { - assertPlan("SELECT * FROM (SELECT *, nationkey + 1 as nationkey2 FROM nation) a JOIN nation b ON a.nationkey = b.nationkey", - output( - join(INNER, builder -> builder - .equiCriteria("L_NATIONKEY", "R_NATIONKEY") - .left( - tableScan("nation", ImmutableMap.of("L_NATIONKEY", "nationkey"))) - .right( - anyTree( - tableScan("nation", ImmutableMap.of("R_NATIONKEY", "nationkey"))))))); - - assertPlan("SELECT * FROM (SELECT * FROM nation WHERE nationkey = 5) a JOIN (SELECT * FROM nation WHERE nationkey = 5) b ON a.nationkey = b.nationkey", - output( - join(INNER, builder -> builder - .equiCriteria(ImmutableList.of()) - .left( - filter("L_NATIONKEY = BIGINT '5'", - tableScan("nation", ImmutableMap.of("L_NATIONKEY", "nationkey")))) - .right( - anyTree( - filter("R_NATIONKEY = BIGINT '5'", - tableScan("nation", ImmutableMap.of("R_NATIONKEY", "nationkey")))))))); - } }