Skip to content

Commit

Permalink
Adjusting README
Browse files Browse the repository at this point in the history
  • Loading branch information
horakivo committed Feb 14, 2025
1 parent ac8f326 commit f1ed3f8
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions graalpy/graalpy-apache-arrow-guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ There is also another option `arrow-memory-netty`. You can read more about Apach
<package>pandas</package> <!---->
<package>pyarrow</package> <!---->
</packages>
<pythonHome>
<includes></includes>
<excludes>.*</excludes>
</pythonHome>
</configuration>
<goals>
<goal>process-graalpy-resources</goal>
Expand Down Expand Up @@ -212,6 +208,8 @@ Bind the Java interface to the Python module.
`Main.java`

```java
private static DataAnalysisPyModule dataAnalysisPyModule;

public static void initDataAnalysisPyModule(Context context) {
Value value = context.eval("python", "import data_analysis; data_analysis");
dataAnalysisPyModule = value.as(DataAnalysisPyModule.class);
Expand Down Expand Up @@ -252,6 +250,11 @@ Finally, use the setup in your main method:

`Main.java`
```java
private static final String PYTHON_URL = "https://www.graalvm.org/compatibility/module_results/python-module-testing-v241.csv";
private static final String JAVASCRIPT_URL = "https://www.graalvm.org/compatibility/module_results/js-module-testing.csv";
private static final Integer PASSING_RATE_COLUMN_INDEX = 3;


public static void main(String[] args) throws IOException, InterruptedException {
try (Context context = initContext();
BufferAllocator allocator = new RootAllocator();
Expand Down Expand Up @@ -285,7 +288,27 @@ or
./gradlew build
```

To run the application:
To run the application using Maven, first define `exec` plugin:

`pom.xml`
```xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.example.Main</mainClass>
</configuration>
</plugin>
```
Run the application using:
```bash
./mvnw exec:java -Dexec.mainClass="com.example.Main"
```
Expand Down

0 comments on commit f1ed3f8

Please sign in to comment.