drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilooner <...@git.apache.org>
Subject [GitHub] drill pull request #984: DRILL-5783 Made a unit test for generated Priority ...
Date Wed, 01 Nov 2017 21:54:14 GMT
Github user ilooner commented on a diff in the pull request:

    https://github.com/apache/drill/pull/984#discussion_r148395420
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/writer/TestCorruptParquetDateCorrection.java
---
    @@ -377,21 +386,21 @@ public void testReadOldMetadataCacheFileOverrideCorrection() throws
Exception {
     
       @Test
       public void testReadNewMetadataCacheFileOverOldAndNewFiles() throws Exception {
    -    String table = format("dfs.`%s`", new Path(getDfsTestTmpSchemaLocation(), MIXED_CORRUPTED_AND_CORRECT_PARTITIONED_FOLDER));
    -    copyMetaDataCacheToTempReplacingInternalPaths(
    +    File meta = dirTestWatcher.copyResourceToRoot(
             "parquet/4203_corrupt_dates/mixed_version_partitioned_metadata.requires_replace.txt",
    -        MIXED_CORRUPTED_AND_CORRECT_PARTITIONED_FOLDER, Metadata.METADATA_FILENAME);
    +        Paths.get(MIXED_CORRUPTED_AND_CORRECT_PARTITIONED_FOLDER, Metadata.METADATA_FILENAME).toString());
    --- End diff --
    
    I've cleaned this up a bit. Of the two patterns for building paths and files I prefer
pattern **A** because it is cleaner.
    
    **Pattern A:**
    ```
    myPath.resolve("subDir1")
      .resolve("subDir2")
      .toFile();
    ```
    
    **Pattern B:**
    ```
    new File(new File(myFile, "subDir1"), "subDir2")
    ```


---

Mime
View raw message