yspjack opened a new issue, #34293:
URL: https://github.com/apache/arrow/issues/34293

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `org.apache.arrow.dataset.jni.JniLoader` cannot load 
"x86_64\arrow_dataset_jni.dll" from JAR file("arrow-dataset-11.0.0.jar" from 
Maven central repository) and throws an exception. However, this example works 
fine on Arrow 10.0.1.
   
   Stack trace
   
   ```
   java.lang.IllegalStateException: error loading native libraries: 
java.io.FileNotFoundException: x86_64\arrow_dataset_jni.dll
        at org.apache.arrow.dataset.jni.JniLoader.load(JniLoader.java:94)
        at 
org.apache.arrow.dataset.jni.JniLoader.loadRemaining(JniLoader.java:74)
        at 
org.apache.arrow.dataset.jni.JniLoader.ensureLoaded(JniLoader.java:61)
        at 
org.apache.arrow.dataset.jni.NativeMemoryPool.getDefault(NativeMemoryPool.java:34)
        at QuickStart.main(QuickStart.java:23)
   ```
   
   QuickStart.java:
   
   ```java
   // Reading a Parquet file using FileSystemDatasetFactory
   import org.apache.arrow.dataset.file.FileFormat;
   import org.apache.arrow.dataset.file.FileSystemDatasetFactory;
   import org.apache.arrow.dataset.jni.NativeMemoryPool;
   import org.apache.arrow.dataset.scanner.ScanOptions;
   import org.apache.arrow.dataset.scanner.Scanner;
   import org.apache.arrow.dataset.source.Dataset;
   import org.apache.arrow.dataset.source.DatasetFactory;
   import org.apache.arrow.memory.BufferAllocator;
   import org.apache.arrow.memory.RootAllocator;
   import org.apache.arrow.vector.VectorSchemaRoot;
   import org.apache.arrow.vector.ipc.ArrowReader;
   
   import java.nio.file.Path;
   
   public class QuickStart {
       public static void main(String[] args) {
           String uri = Path.of("data1.parquet").toUri().toString();
           System.out.println(uri);
           ScanOptions options = new ScanOptions(32768);
           try (
                   BufferAllocator allocator = new RootAllocator();
                   DatasetFactory datasetFactory = new 
FileSystemDatasetFactory(allocator, NativeMemoryPool.getDefault(), 
FileFormat.PARQUET, uri);
                   Dataset dataset = datasetFactory.finish();
                   Scanner scanner = dataset.newScan(options);
                   ArrowReader reader = scanner.scanBatches()
           ) {
               while (reader.loadNextBatch()) {
                   try (VectorSchemaRoot root = reader.getVectorSchemaRoot()) {
                       System.out.print(root.contentToTSVString());
                   }
               }
           } catch (Exception e) {
               e.printStackTrace();
           }
       }
   }
   
   ```
   
   Version: arrow 11.0.0
   
   Dependencies:
   - org.apache.arrow:arrow-vector:11.0.0
   - org.apache.arrow:arrow-memory:11.0.0
   - org.apache.arrow:arrow-memory-netty:11.0.0
   - org.apache.arrow:arrow-dataset:11.0.0
   
   Platform:
   
   - OS: Windows 11 x64
   - JDK version: 17
   
   ### Component(s)
   
   Java


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