Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
import static com.facebook.presto.SystemSessionProperties.ENABLE_DYNAMIC_FILTERING;
import static com.facebook.presto.SystemSessionProperties.JOIN_DISTRIBUTION_TYPE;
import static com.facebook.presto.SystemSessionProperties.JOIN_REORDERING_STRATEGY;
import static com.facebook.presto.SystemSessionProperties.PUSHDOWN_SUBFIELDS_ENABLED;
import static com.facebook.presto.hive.HiveQueryRunner.HIVE_CATALOG;
import static com.facebook.presto.hive.HiveSessionProperties.PUSHDOWN_FILTER_ENABLED;
import static com.facebook.presto.sql.analyzer.FeaturesConfig.JoinDistributionType.BROADCAST;
import static io.airlift.tpch.TpchTable.getTables;
import static org.testng.Assert.assertEquals;
Expand All @@ -55,7 +58,9 @@ protected Session getSession()
{
return Session.builder(super.getSession())
.setSystemProperty(ENABLE_DYNAMIC_FILTERING, "true")
.setSystemProperty(PUSHDOWN_SUBFIELDS_ENABLED, "true")
.setSystemProperty(JOIN_DISTRIBUTION_TYPE, BROADCAST.name())
.setCatalogSessionProperty(HIVE_CATALOG, PUSHDOWN_FILTER_ENABLED, "true")
.build();
}

Expand All @@ -64,6 +69,8 @@ public void testJoinWithEmptyBuildSide()
{
Session session = Session.builder(getSession())
.setSystemProperty(JOIN_DISTRIBUTION_TYPE, FeaturesConfig.JoinDistributionType.BROADCAST.name())
.setSystemProperty(PUSHDOWN_SUBFIELDS_ENABLED, "false")
.setCatalogSessionProperty(HIVE_CATALOG, PUSHDOWN_FILTER_ENABLED, "false")
.build();
DistributedQueryRunner runner = (DistributedQueryRunner) getQueryRunner();
ResultWithQueryId<MaterializedResult> result = runner.executeWithQueryId(
Expand All @@ -81,6 +88,8 @@ public void testJoinWithSelectiveBuildSide()
{
Session session = Session.builder(getSession())
.setSystemProperty(JOIN_DISTRIBUTION_TYPE, FeaturesConfig.JoinDistributionType.BROADCAST.name())
.setSystemProperty(PUSHDOWN_SUBFIELDS_ENABLED, "false")
.setCatalogSessionProperty(HIVE_CATALOG, PUSHDOWN_FILTER_ENABLED, "false")
.build();
DistributedQueryRunner runner = (DistributedQueryRunner) getQueryRunner();
ResultWithQueryId<MaterializedResult> result = runner.executeWithQueryId(
Expand Down Expand Up @@ -129,6 +138,20 @@ public void testJoinOnNullPartitioning()
assertQuery(session, query, "SELECT null, 2, 2, 2");
}

@Test
public void testMixedJoin()
{
// Mixed join could produce conjunction dynamic filters, we should be able to extract them out when integrating with filter pushdown
assertQuery("SELECT * FROM\n" +
"lineitem l1 LEFT OUTER JOIN part p1\n" +
"ON l1.orderkey = p1.partkey AND p1.size = 47\n" +
"INNER JOIN orders o1 ON l1.orderkey = o1.orderkey\n" +
"AND o1.custkey = 397\n" +
"LEFT OUTER JOIN part p2\n" +
"ON p1.name = p2.name AND p1.partkey = p2.partkey\n" +
"WHERE o1.shippriority = 0");
}

private OperatorStats searchScanFilterAndProjectOperatorStats(QueryId queryId, String tableName)
{
DistributedQueryRunner runner = (DistributedQueryRunner) getQueryRunner();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ public void testJoinWithInSubqueryToBeExecutedAsPostJoinFilter()
}
}

@Test
@Test(enabled = false)
public void testOuterJoinWithExpression()
{
assertQuery("SELECT o.orderkey FROM orders o RIGHT JOIN lineitem l ON l.orderkey * 2 + 1 = o.orderkey");
Expand Down