drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdiravka <...@git.apache.org>
Subject [GitHub] drill pull request #824: DRILL-3867: Store relative paths in metadata file
Date Thu, 22 Jun 2017 15:52:14 GMT
Github user vdiravka commented on a diff in the pull request:

    https://github.com/apache/drill/pull/824#discussion_r123512327
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java ---
    @@ -593,4 +610,49 @@ private void convert(List<QueryDataBatch> batches) throws SchemaChangeException
           }
         }
       }
    +
    +  private static String replaceWorkingPathInString(String orig) {
    +    return orig.replaceAll(Pattern.quote("[WORKING_PATH]"), Matcher.quoteReplacement(TestTools.getWorkingPath()));
    +  }
    +
    +  protected static void copyDirectoryIntoTempSpace(String resourcesDir) throws IOException
{
    +    copyDirectoryIntoTempSpace(resourcesDir, null);
    +  }
    +
    +  protected static void copyDirectoryIntoTempSpace(String resourcesDir, String destinationSubDir)
throws IOException {
    +    Path destination = destinationSubDir != null ? new Path(getDfsTestTmpSchemaLocation(),
destinationSubDir)
    +        : new Path(getDfsTestTmpSchemaLocation());
    +    fs.copyFromLocalFile(
    +        new Path(replaceWorkingPathInString(resourcesDir)),
    +        destination);
    +  }
    +
    +  /**
    +   * Metadata cache files include full paths to the files that have been scanned.
    --- End diff --
    
    I wanted to do this, but found that will be incorrect, since that files have `metadata
version` `v1` and `v2`. These versions metadata cache files can contain only absolute paths.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message