Skip to content

Commit

Permalink
Fix failing test on master
Browse files Browse the repository at this point in the history
  • Loading branch information
sopel39 authored and wendigo committed Dec 27, 2023
1 parent c106cf5 commit ee7046b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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"))))))));
}
}

0 comments on commit ee7046b

Please sign in to comment.