pavibhai commented on code in PR #6293:
URL: https://github.com/apache/iceberg/pull/6293#discussion_r1042049334


##########
orc/src/test/java/org/apache/iceberg/orc/TestOrcDataWriter.java:
##########
@@ -126,4 +135,116 @@ public void testDataWriter() throws IOException {
 
     Assert.assertEquals("Written records should match", records, 
writtenRecords);
   }
+
+  @Test
+  public void testUsingFileIO() throws IOException {
+    // Show that FileSystem access is not possible for the file we are 
supplying as the scheme
+    // dummy is not handled
+    ProxyOutputFile outFile = new 
ProxyOutputFile(Files.localOutput(temp.newFile()));
+    Assertions.assertThatThrownBy(
+            () -> HadoopOutputFile.fromPath(new Path(outFile.location()), new 
Configuration()))
+        .isInstanceOf(RuntimeIOException.class)
+        .hasMessageStartingWith("Failed to get file system for path: dummy");
+
+    // We are creating the proxy
+    SortOrder sortOrder = 
SortOrder.builderFor(SCHEMA).withOrderId(10).asc("id").build();
+
+    DataWriter<Record> dataWriter =
+        ORC.writeData(outFile)
+            .schema(SCHEMA)
+            .createWriterFunc(GenericOrcWriter::buildWriter)
+            .overwrite()
+            .withSpec(PartitionSpec.unpartitioned())

Review Comment:
   Sorry didn't follow this. What do we mean by default?
   
   Before the patch if you gave a Local[Output|Input]File this was converted to 
FileSystem operation resulting in a LocalFileSystem for handling this.
   To ensure that is not taking place, we are mimicking a schema `dummy` that 
is not handled, so if any FS operations happen normally then it will fail with 
`Failed to get file system for path: dummy` but if handled via FileIOFS then it 
should be successful.
   
   I will add this comment to the test to make it clearer.



-- 
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-unsubscr...@iceberg.apache.org

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


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

Reply via email to