Skip to content

Commit dfaa139

Browse files
committed
Adjusting README
1 parent ac8f326 commit dfaa139

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

graalpy/graalpy-apache-arrow-guide/README.md

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ Add the required dependencies for GraalPy and JArrow in the dependency section o
2121
### 3.1 GraalPy dependencies
2222
`pom.xml`
2323
```xml
24-
<dependency>
25-
<groupId>org.graalvm.python</groupId>
26-
<artifactId>python-community</artifactId> <!---->
27-
<version>${python.version}</version>
28-
<type>pom</type> <!---->
29-
</dependency>
30-
<dependency>
31-
<groupId>org.graalvm.python</groupId>
32-
<artifactId>python-embedding</artifactId> <!---->
33-
<version>${python.version}</version>
34-
</dependency>
24+
<dependency>
25+
<groupId>org.graalvm.python</groupId>
26+
<artifactId>python-community</artifactId> <!---->
27+
<version>${python.version}</version>
28+
<type>pom</type> <!---->
29+
</dependency>
30+
<dependency>
31+
<groupId>org.graalvm.python</groupId>
32+
<artifactId>python-embedding</artifactId> <!---->
33+
<version>${python.version}</version>
34+
</dependency>
3535
```
3636

3737
or
3838

3939
`build.gradle`
40-
```
40+
```groovy
4141
implementation "org.graalvm.python:python-community:$pythonVersion" // ①
4242
implementation "org.graalvm.python:python-embedding:$pythonVersion" // ③
4343
```
@@ -95,10 +95,6 @@ There is also another option `arrow-memory-netty`. You can read more about Apach
9595
<package>pandas</package> <!---->
9696
<package>pyarrow</package> <!---->
9797
</packages>
98-
<pythonHome>
99-
<includes></includes>
100-
<excludes>.*</excludes>
101-
</pythonHome>
10298
</configuration>
10399
<goals>
104100
<goal>process-graalpy-resources</goal>
@@ -212,6 +208,8 @@ Bind the Java interface to the Python module.
212208
`Main.java`
213209

214210
```java
211+
private static DataAnalysisPyModule dataAnalysisPyModule;
212+
215213
public static void initDataAnalysisPyModule(Context context) {
216214
Value value = context.eval("python", "import data_analysis; data_analysis");
217215
dataAnalysisPyModule = value.as(DataAnalysisPyModule.class);
@@ -252,6 +250,11 @@ Finally, use the setup in your main method:
252250

253251
`Main.java`
254252
```java
253+
private static final String PYTHON_URL = "https://www.graalvm.org/compatibility/module_results/python-module-testing-v241.csv";
254+
private static final String JAVASCRIPT_URL = "https://www.graalvm.org/compatibility/module_results/js-module-testing.csv";
255+
private static final Integer PASSING_RATE_COLUMN_INDEX = 3;
256+
257+
255258
public static void main(String[] args) throws IOException, InterruptedException {
256259
try (Context context = initContext();
257260
BufferAllocator allocator = new RootAllocator();
@@ -285,7 +288,27 @@ or
285288
./gradlew build
286289
```
287290

288-
To run the application:
291+
To run the application using Maven, first define `exec` plugin:
292+
293+
`pom.xml`
294+
```xml
295+
<plugin>
296+
<groupId>org.codehaus.mojo</groupId>
297+
<artifactId>exec-maven-plugin</artifactId>
298+
<version>1.2.1</version>
299+
<executions>
300+
<execution>
301+
<goals>
302+
<goal>java</goal>
303+
</goals>
304+
</execution>
305+
</executions>
306+
<configuration>
307+
<mainClass>com.example.Main</mainClass>
308+
</configuration>
309+
</plugin>
310+
```
311+
Run the application using:
289312
```bash
290313
./mvnw exec:java -Dexec.mainClass="com.example.Main"
291314
```

0 commit comments

Comments
 (0)