Skip to content

Commit 977d56f

Browse files
authored
upgrade arrow maven dependencies (version 9) (#61)
* upgrade arrow maven dependencies * bump version of java toolchain * add java open
1 parent 0885745 commit 977d56f

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

buildSrc/src/main/groovy/datafusion.java-conventions.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repositories {
1111

1212
java {
1313
toolchain {
14-
languageVersion = JavaLanguageVersion.of(15)
14+
languageVersion = JavaLanguageVersion.of(17)
1515
}
1616
}
1717

datafusion-examples/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ spotless {
1313
dependencies {
1414
implementation project(':datafusion-java')
1515
implementation 'org.slf4j:slf4j-api:1.7.36'
16-
implementation 'ch.qos.logback:logback-classic:1.2.11'
17-
implementation 'org.apache.arrow:arrow-format:8.0.0'
18-
implementation 'org.apache.arrow:arrow-vector:8.0.0'
16+
implementation 'ch.qos.logback:logback-classic:1.4.0'
17+
implementation 'org.apache.arrow:arrow-format:9.0.0'
18+
implementation 'org.apache.arrow:arrow-vector:9.0.0'
1919
}
2020

2121
application {
2222
mainClass = 'org.apache.arrow.datafusion.examples.ExampleMain'
2323
def libraryPath = findProperty("JNI_PATH") ?: "$rootDir/datafusion-java/build/jni_libs/dev"
24-
applicationDefaultJvmArgs += "-Djava.library.path=$libraryPath"
24+
applicationDefaultJvmArgs += ["-Djava.library.path=$libraryPath", "--add-opens=java.base/java.nio=ALL-UNNAMED"]
2525
}
2626

2727
tasks.named("run").configure {

datafusion-examples/src/main/java/org/apache/arrow/datafusion/examples/ExampleMain.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.apache.arrow.datafusion.examples;
22

33
import java.io.IOException;
4+
import java.nio.file.Files;
5+
import java.nio.file.Path;
46
import java.nio.file.Paths;
57
import java.util.concurrent.CompletableFuture;
68
import org.apache.arrow.datafusion.DataFrame;
@@ -39,14 +41,16 @@ public static void main(String[] args) throws Exception {
3941
.thenAccept(ExampleMain::consumeReader)
4042
.join();
4143

44+
Path tempPath = Files.createTempDirectory("datafusion-examples");
45+
4246
context
4347
.sql("select * from test_parquet limit 3")
44-
.thenComposeAsync(df -> df.writeCsv(Paths.get("build/tmp/csv-out")))
48+
.thenComposeAsync(df -> df.writeCsv(tempPath.resolve("csv-out")))
4549
.join();
4650

4751
context
4852
.sql("select * from test_parquet limit 3")
49-
.thenComposeAsync(df -> df.writeParquet(Paths.get("build/tmp/parquet-out")))
53+
.thenComposeAsync(df -> df.writeParquet(tempPath.resolve("parquet-out")))
5054
.join();
5155
}
5256
}

datafusion-java/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ plugins {
99

1010
dependencies {
1111
implementation 'org.slf4j:slf4j-api:1.7.36'
12-
implementation 'org.apache.arrow:arrow-format:8.0.0'
13-
implementation 'org.apache.arrow:arrow-vector:8.0.0'
14-
runtimeOnly 'org.apache.arrow:arrow-memory-unsafe:8.0.0'
12+
implementation 'org.apache.arrow:arrow-format:9.0.0'
13+
implementation 'org.apache.arrow:arrow-vector:9.0.0'
14+
runtimeOnly 'org.apache.arrow:arrow-memory-unsafe:9.0.0'
1515
}
1616

1717
spotless {

datafusion-java/src/main/java/org/apache/arrow/datafusion/DataFrame.java

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public interface DataFrame extends NativeProxy {
3838

3939
/**
4040
* Write results to a csv file.
41+
*
4142
* @param path path to write csv file to
4243
* @return null
4344
*/

datafusion-java/src/main/java/org/apache/arrow/datafusion/DataFrames.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ static native void collectDataframe(
1616
long runtime, long dataframe, BiConsumer<String, byte[]> callback);
1717

1818
static native void writeParquet(
19-
long runtime, long dataframe, String path, Consumer<String> callback);
19+
long runtime, long dataframe, String path, Consumer<String> callback);
2020

21-
static native void writeCsv(
22-
long runtime, long dataframe, String path, Consumer<String> callback);
21+
static native void writeCsv(long runtime, long dataframe, String path, Consumer<String> callback);
2322
}

0 commit comments

Comments
 (0)