Github user ilooner commented on a diff in the pull request:
https://github.com/apache/drill/pull/1117#discussion_r167694158
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/join/TestHashJoinAdvanced.java
---
@@ -197,4 +198,24 @@ public void emptyPartTest() throws Exception {
BaseTestQuery.resetSessionOption(ExecConstants.SLICE_TARGET);
}
}
+
+ @Test // DRILL-6089
+ public void testJoinOrdering() throws Exception {
+ final String query = "select * from dfs.`sample-data/nation.parquet`
nation left outer join " +
+ "(select * from dfs.`sample-data/region.parquet`) " +
+ "as region on region.r_regionkey = nation.n_nationkey order by
region.r_name desc";
+ final String plan = getPlanInString("EXPLAIN PLAN for " +
QueryTestUtil.normalizeQuery(query), OPTIQ_FORMAT);
+ lastSortAfterJoin(plan);
--- End diff --
The method `testPlanMatchingPatterns(String query, String[]
expectedPatterns, String[] excludedPatterns)` is not sufficient out of the box
since I have to add the `Pattern.DOTALL` flag when compiling the pattern in
order to have the regex match across new lines. So I've added
`testPlanMatchingPatterns(String query, Pattern[] expectedPatterns, Pattern[]
excludedPatterns)`
---