lidavidm commented on code in PR #14182:
URL: https://github.com/apache/arrow/pull/14182#discussion_r989194714


##########
java/dataset/src/test/java/org/apache/arrow/dataset/file/TestFileSystemDataset.java:
##########
@@ -361,6 +362,30 @@ public void testBaseOrcRead() throws Exception {
     AutoCloseables.close(factory);
   }
 
+  @Test
+  public void testBaseCsvRead() throws Exception {
+    CsvWriteSupport writeSupport = CsvWriteSupport.writeTempFile(
+            TMP.newFolder(), "Name,Language", "Juno,Java", "Peter,Python", 
"Celin,C++");
+    String expectedJsonUnordered = "[[\"Juno\", \"Java\"], [\"Peter\", 
\"Python\"], [\"Celin\", \"C++\"]]";
+    FileSystemDatasetFactory factory = new 
FileSystemDatasetFactory(rootAllocator(), NativeMemoryPool.getDefault(),
+            FileFormat.CSV, writeSupport.getOutputURI());
+
+    ScanOptions options = new ScanOptions(100);
+    Schema schema = inferResultSchemaFromFactory(factory, options);
+    List<ArrowRecordBatch> datum = collectResultFromFactory(factory, options);
+
+    System.out.println(schema);
+    assertScanBatchesProduced(factory, options);
+    assertEquals(1, datum.size());
+    assertEquals(2, schema.getFields().size());
+    assertEquals("Name", schema.getFields().get(0).getName());
+
+    checkParquetReadResult(schema, expectedJsonUnordered, datum);
+
+    AutoCloseables.close(datum);

Review Comment:
   Use try-with-resources?



##########
java/dataset/src/main/cpp/jni_wrapper.cc:
##########
@@ -91,10 +91,10 @@ arrow::Result<std::shared_ptr<arrow::dataset::FileFormat>> 
GetFileFormat(
       return std::make_shared<arrow::dataset::ParquetFileFormat>();
     case 1:
       return std::make_shared<arrow::dataset::IpcFileFormat>();
-#ifdef ARROW_ORC

Review Comment:
   We probably still need this? Or we need to document that building this 
requires ORC to also be enabled



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

Reply via email to