Skip to content

Commit

Permalink
Remove redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sopel39 committed Oct 2, 2019
1 parent 1725223 commit a9c94c1
Showing 1 changed file with 1 addition and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,46 +198,14 @@ public void ruleAddedTableLayoutToFilterTableScan()
Map<String, Domain> filterConstraint = ImmutableMap.<String, Domain>builder()
.put("orderstatus", singleValue(createVarcharType(1), utf8Slice("F")))
.build();
tester().assertThat(pushPredicateIntoTableScan)
.on(p -> p.filter(expression("orderstatus = CAST ('F' AS VARCHAR(1))"),
p.tableScan(
ordersTableHandle,
ImmutableList.of(p.symbol("orderstatus", createVarcharType(1))),
ImmutableMap.of(p.symbol("orderstatus", createVarcharType(1)), new TpchColumnHandle("orderstatus", createVarcharType(1))))))
.matches(
constrainedTableScanWithTableLayout("orders", filterConstraint, ImmutableMap.of("orderstatus", "orderstatus")));
}

@Test
public void ruleAddedNewTableLayoutIfTableScanHasEmptyConstraint()
{
tester().assertThat(pushPredicateIntoTableScan)
.on(p -> p.filter(expression("orderstatus = 'F'"),
p.tableScan(
ordersTableHandle,
ImmutableList.of(p.symbol("orderstatus", createVarcharType(1))),
ImmutableMap.of(p.symbol("orderstatus", createVarcharType(1)), new TpchColumnHandle("orderstatus", createVarcharType(1))))))
.matches(
constrainedTableScanWithTableLayout(
"orders",
ImmutableMap.of("orderstatus", singleValue(createVarcharType(1), utf8Slice("F"))),
ImmutableMap.of("orderstatus", "orderstatus")));
}

@Test
public void ruleWithPushdownableToTableLayoutPredicate()
{
Type orderStatusType = createVarcharType(1);
tester().assertThat(pushPredicateIntoTableScan)
.on(p -> p.filter(expression("orderstatus = 'O'"),
p.tableScan(
ordersTableHandle,
ImmutableList.of(p.symbol("orderstatus", orderStatusType)),
ImmutableMap.of(p.symbol("orderstatus", orderStatusType), new TpchColumnHandle("orderstatus", orderStatusType)))))
.matches(constrainedTableScanWithTableLayout(
"orders",
ImmutableMap.of("orderstatus", singleValue(orderStatusType, utf8Slice("O"))),
ImmutableMap.of("orderstatus", "orderstatus")));
constrainedTableScanWithTableLayout("orders", filterConstraint, ImmutableMap.of("orderstatus", "orderstatus")));
}

@Test
Expand Down

0 comments on commit a9c94c1

Please sign in to comment.