arina-ielchiieva commented on a change in pull request #1883: DRILL-7418: MetadataDirectGroupScan improvements URL: https://github.com/apache/drill/pull/1883#discussion_r340045287
########## File path: exec/java-exec/src/test/java/org/apache/drill/test/QueryBuilder.java ########## @@ -764,4 +765,45 @@ protected String queryPlan(String columnName) throws Exception { return builder.toString(); } + + /** + * Collects expected and non-expected query patterns. + * Upon {@link #match()} method call, matches given patterns to the query plan. + */ + public static class PlanMatcher { + + private static final String EXPECTED_NOT_FOUND = "Did not find expected pattern"; + private static final String UNEXPECTED_FOUND = "Found unwanted pattern"; + + private final String plan; + private final List<String> included = new ArrayList<>(); + private final List<String> excluded = new ArrayList<>(); + + public PlanMatcher(String plan) { + this.plan = plan; + } + + public PlanMatcher include(String... patterns) { + included.addAll(Arrays.asList(patterns)); + return this; + } + + public PlanMatcher exclude(String... patterns) { + excluded.addAll(Arrays.asList(patterns)); + return this; + } + + public void match() { Review comment: Added. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services