anoopj commented on code in PR #17434:
URL: https://github.com/apache/iceberg/pull/17434#discussion_r3722044416


##########
core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java:
##########
@@ -723,38 +731,203 @@ public void unknownManifestFormatThrows() throws 
IOException {
     InputFile badFile =
         fileIO.newInputFile(tempDir.resolve("manifest-" + System.nanoTime() + 
".txt").toString());
 
-    try (V4ManifestReader reader = V4ManifestReader.builder(badFile, 
UNPARTITIONED_SPECS).build()) {
+    try (V4ManifestReader reader =
+        V4ManifestReader.builder(badFile, UNPARTITIONED_SPECS, 
TABLE_LOCATION).build()) {
       assertThatThrownBy(reader::iterator)
           .isInstanceOf(IllegalArgumentException.class)
           .hasMessageContaining("Cannot determine format of manifest");
     }
   }
 
+  @ParameterizedTest
+  @FieldSource("MANIFEST_FORMATS")
+  public void resolvesRelativeDataFileLocation(FileFormat format) throws 
IOException {
+    TrackedFile file = dataFile("data/00000-0.parquet", EMPTY_PARTITION_DATA);
+    verifyLocation(format, file, TABLE_LOCATION + "/data/00000-0.parquet");
+  }
+
+  @ParameterizedTest
+  @FieldSource("MANIFEST_FORMATS")
+  public void absoluteDataFileLocationIsUnchanged(FileFormat format) throws 
IOException {

Review Comment:
    Agreed. I removed all tests that had an overlap with `TestLocationUtil`



##########
core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java:
##########
@@ -723,38 +731,203 @@ public void unknownManifestFormatThrows() throws 
IOException {
     InputFile badFile =
         fileIO.newInputFile(tempDir.resolve("manifest-" + System.nanoTime() + 
".txt").toString());
 
-    try (V4ManifestReader reader = V4ManifestReader.builder(badFile, 
UNPARTITIONED_SPECS).build()) {
+    try (V4ManifestReader reader =
+        V4ManifestReader.builder(badFile, UNPARTITIONED_SPECS, 
TABLE_LOCATION).build()) {
       assertThatThrownBy(reader::iterator)
           .isInstanceOf(IllegalArgumentException.class)
           .hasMessageContaining("Cannot determine format of manifest");
     }
   }
 
+  @ParameterizedTest
+  @FieldSource("MANIFEST_FORMATS")
+  public void resolvesRelativeDataFileLocation(FileFormat format) throws 
IOException {
+    TrackedFile file = dataFile("data/00000-0.parquet", EMPTY_PARTITION_DATA);
+    verifyLocation(format, file, TABLE_LOCATION + "/data/00000-0.parquet");

Review Comment:
   Done.



##########
core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java:
##########
@@ -723,38 +731,203 @@ public void unknownManifestFormatThrows() throws 
IOException {
     InputFile badFile =
         fileIO.newInputFile(tempDir.resolve("manifest-" + System.nanoTime() + 
".txt").toString());
 
-    try (V4ManifestReader reader = V4ManifestReader.builder(badFile, 
UNPARTITIONED_SPECS).build()) {
+    try (V4ManifestReader reader =
+        V4ManifestReader.builder(badFile, UNPARTITIONED_SPECS, 
TABLE_LOCATION).build()) {
       assertThatThrownBy(reader::iterator)
           .isInstanceOf(IllegalArgumentException.class)
           .hasMessageContaining("Cannot determine format of manifest");
     }
   }
 
+  @ParameterizedTest
+  @FieldSource("MANIFEST_FORMATS")
+  public void resolvesRelativeDataFileLocation(FileFormat format) throws 
IOException {
+    TrackedFile file = dataFile("data/00000-0.parquet", EMPTY_PARTITION_DATA);

Review Comment:
   Agree that the `.parquet` extension was misleading. Dropped it.



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

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to