jinchengchenghh commented on code in PR #43503:
URL: https://github.com/apache/arrow/pull/43503#discussion_r1701223834


##########
java/dataset/src/test/java/org/apache/arrow/dataset/TestFragmentScanOptions.java:
##########
@@ -102,30 +119,38 @@ public void testCsvConvertOptionsDelimiterNotSet() throws 
Exception {
     String path = "file://" + getClass().getResource("/").getPath() + 
"/data/student.csv";
     BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);
     try (ArrowSchema cSchema = ArrowSchema.allocateNew(allocator);
+        ArrowSchema cSchema2 = ArrowSchema.allocateNew(allocator);
         CDataDictionaryProvider provider = new CDataDictionaryProvider()) {
       Data.exportSchema(allocator, schema, provider, cSchema);
-      CsvConvertOptions convertOptions = new 
CsvConvertOptions(ImmutableMap.of());
-      convertOptions.setArrowSchema(cSchema);
-      CsvFragmentScanOptions fragmentScanOptions =
-          new CsvFragmentScanOptions(convertOptions, ImmutableMap.of(), 
ImmutableMap.of());
+      Data.exportSchema(allocator, schema, provider, cSchema2);
+      CsvFragmentScanOptions fragmentScanOptions1 =
+          create(cSchema, ImmutableMap.of(), ImmutableMap.of(), 
ImmutableMap.of());
+      CsvFragmentScanOptions fragmentScanOptions2 =
+          create(cSchema2, ImmutableMap.of(), ImmutableMap.of(), 
ImmutableMap.of());
       ScanOptions options =
           new ScanOptions.Builder(/*batchSize*/ 32768)
               .columns(Optional.empty())
-              .fragmentScanOptions(fragmentScanOptions)
+              .fragmentScanOptions(fragmentScanOptions1)
               .build();
       try (DatasetFactory datasetFactory =
               new FileSystemDatasetFactory(
-                  allocator, NativeMemoryPool.getDefault(), FileFormat.CSV, 
path);
+                  allocator,
+                  NativeMemoryPool.getDefault(),
+                  FileFormat.CSV,
+                  path,
+                  Optional.of(fragmentScanOptions2));
           Dataset dataset = datasetFactory.finish();
           Scanner scanner = dataset.newScan(options);
           ArrowReader reader = scanner.scanBatches()) {
-
-        assertEquals(schema.getFields(), 
reader.getVectorSchemaRoot().getSchema().getFields());
         int rowCount = 0;
         while (reader.loadNextBatch()) {
-          final ValueIterableVector<Integer> idVector =
-              (ValueIterableVector<Integer>) 
reader.getVectorSchemaRoot().getVector("Id");
-          assertThat(idVector.getValueIterable(), 
IsIterableContainingInOrder.contains(1, 2, 3));
+          final ValueIterableVector<Text> idVector =
+              (ValueIterableVector<Text>)
+                  reader.getVectorSchemaRoot().getVector("Id;Name;Language");

Review Comment:
   My fault, I does not run the unit test in local, only test the code 
integrated by my project.
   I believe the CI would run the test, but not.



-- 
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: github-unsubscr...@arrow.apache.org

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

Reply via email to