vvysotskyi commented on a change in pull request #1883: DRILL-7418: 
MetadataDirectGroupScan improvements
URL: https://github.com/apache/drill/pull/1883#discussion_r339697900
 
 

 ##########
 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:
   Could you please add JavaDoc for this method, since it may be possible to 
mix-up this and `Matcher.matches()` goals due to similar names, since here we 
do not require an entire string match to the pattern, only string parts.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to