You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/11/03 12:00:22 UTC

[GitHub] [iceberg] nastra commented on a diff in pull request #4826: Nessie: Use unique path for different table with same name

nastra commented on code in PR #4826:
URL: https://github.com/apache/iceberg/pull/4826#discussion_r1012799689


##########
nessie/src/test/java/org/apache/iceberg/nessie/BaseTestIceberg.java:
##########
@@ -80,7 +80,7 @@ public abstract class BaseTestIceberg {
 
   private static final Logger LOG = LoggerFactory.getLogger(BaseTestIceberg.class);
 
-  @TempDir public Path temp;
+  @TempDir public File temp;

Review Comment:
   what's the reason from switching from `Path` to `File`? The `File` API is considered **old** and `Path` should generally be preferred imo. Also the tests should work without having to change this. 
   The only place you'd have to adjust is `TestNessieTable#testCreate()`: `String expected = (temp.toUri() + DB_NAME + "/" + tableName).replace("///", "/")` to `String expected = (temp.toUri() + DB_NAME + "/" + tableName)`



##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNessieTable.java:
##########
@@ -567,40 +567,29 @@ public void testGCEnabled() {
   }
 
   private String getTableBasePath(String tableName) {
-    String databasePath = temp.toString() + "/" + DB_NAME;
-    return Paths.get(databasePath, tableName).toAbsolutePath().toString();
-  }
-
-  protected Path getTableLocationPath(String tableName) {
-    return new Path("file", null, Paths.get(getTableBasePath(tableName)).toString());
-  }
-
-  protected String getTableLocation(String tableName) {
-    return getTableLocationPath(tableName).toString();
-  }
-
-  private String metadataLocation(String tableName) {
-    return Paths.get(getTableBasePath(tableName), "metadata").toString();
+    return temp.toURI() + DB_NAME + "/" + tableName;
   }
 
   @SuppressWarnings(
       "RegexpSinglelineJava") // respecting this rule requires a lot more lines of code
-  private List<String> metadataFiles(String tableName) {
-    return Arrays.stream(Objects.requireNonNull(new File(metadataLocation(tableName)).listFiles()))
+  private List<String> metadataFiles(String tablePath) {
+

Review Comment:
   nit: unnecessary whitespace



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org