[ 
https://issues.apache.org/jira/browse/TAJO-1426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14372852#comment-14372852
 ] 

ASF GitHub Bot commented on TAJO-1426:
--------------------------------------

Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/441#discussion_r26892972
  
    --- Diff: tajo-core/src/test/java/org/apache/tajo/QueryTestCaseBase.java ---
    @@ -317,6 +333,60 @@ public ResultSet executeQuery() throws Exception {
         return executeFile(getMethodName() + ".sql");
       }
     
    +  private volatile Description current;
    +
    +  @Rule
    +  public TestRule watcher = new TestWatcher() {
    +    @Override
    +    protected void starting(Description description) {
    +      QueryTestCaseBase.this.current = description;
    +    }
    +  };
    +
    +  @Target({ElementType.METHOD})
    +  @Retention(RetentionPolicy.RUNTIME)
    +  protected static @interface SimpleTest {
    +    String[] queries();
    +    String[] cleanupTables() default {};
    +  }
    +
    +  protected void runSimpleTests() throws Exception {
    +    String methodName = getMethodName();
    +    Method method = current.getTestClass().getMethod(methodName);
    +    SimpleTest annotation = method.getAnnotation(SimpleTest.class);
    +    if (annotation == null) {
    +      throw new IllegalStateException("Cannot find test annotation");
    +    }
    +    String[] queries = annotation.queries();
    +    try {
    +      for (int i = 0; i < queries.length; i++) {
    +        ResultSet result = client.executeQueryAndGetResult(queries[i]);
    +        Path resultPath = StorageUtil.concatPath(
    +            currentResultPath, methodName + "." + String.valueOf(i + 1) + 
".result");
    +        if (currentResultFS.exists(resultPath)) {
    +          assertEquals("Result Verification",
    +              
FileUtil.readTextFromStream(currentResultFS.open(resultPath)), 
resultSetToString(result).trim());
    +        } else if (!isNull(result)) {
    +          FileUtil.writeTextToStream(resultSetToString(result).trim(), 
currentResultFS.create(resultPath));
    --- End diff --
    
    Would you explain the purpose of the else if clause?


> Support "explain physical" to get physical plan
> -----------------------------------------------
>
>                 Key: TAJO-1426
>                 URL: https://issues.apache.org/jira/browse/TAJO-1426
>             Project: Tajo
>          Issue Type: Improvement
>            Reporter: Navis
>            Assignee: Navis
>            Priority: Minor
>
> Inconvenient to see that in log file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to