Skip to content

Commit f313503

Browse files
committed
feat: Java bindings + Spark V2 datasource
1 parent 5d10e73 commit f313503

34 files changed

+1396
-0
lines changed

Cargo.lock

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ members = [
33
"bench-vortex",
44
"encodings/*",
55
"fuzz",
6+
"java/vortex-jni",
67
"pyvortex",
78
"vortex",
89
"vortex-array",

java/.gitattributes

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+
10+
# Binary files should be left untouched
11+
*.jar binary
12+

java/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build

java/build.gradle.kts

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import net.ltgt.gradle.errorprone.errorprone
2+
3+
plugins {
4+
id("com.diffplug.spotless") version "7.0.1"
5+
id("com.palantir.consistent-versions") version "2.31.0"
6+
id("com.palantir.git-version") version "3.1.0"
7+
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
8+
id("net.ltgt.errorprone") version "4.1.0" apply false
9+
id("org.inferred.processors") version "3.7.0" apply false
10+
}
11+
12+
val gitVersion: groovy.lang.Closure<String> by extra
13+
version = gitVersion()
14+
15+
allprojects {
16+
apply(plugin = "com.diffplug.spotless")
17+
18+
repositories {
19+
mavenCentral()
20+
}
21+
22+
tasks.withType<Test> {
23+
useJUnitPlatform()
24+
25+
maxHeapSize = "1G"
26+
27+
testLogging {
28+
events("passed")
29+
}
30+
}
31+
32+
plugins.withType<JavaLibraryPlugin> {
33+
apply(plugin = "net.ltgt.errorprone")
34+
apply(plugin = "org.inferred.processors")
35+
36+
dependencies {
37+
"errorprone"("com.google.errorprone:error_prone_core")
38+
"errorprone"("com.jakewharton.nopen:nopen-checker")
39+
"compileOnly"("com.jakewharton.nopen:nopen-annotations")
40+
}
41+
42+
spotless {
43+
java {
44+
palantirJavaFormat()
45+
licenseHeaderFile("${rootProject.projectDir}/.spotless/java-license-header.txt")
46+
}
47+
}
48+
49+
tasks.withType<JavaCompile> {
50+
options.errorprone.disable("UnusedVariable")
51+
options.compilerArgs.add("--enable-preview")
52+
53+
// Needed to make sure that the barista-annotations emits to the correct directory
54+
options.generatedSourceOutputDirectory = projectDir.resolve("generated_src")
55+
}
56+
57+
tasks.withType<Javadoc> {
58+
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:-missing")
59+
}
60+
61+
the<JavaPluginExtension>().toolchain.languageVersion = JavaLanguageVersion.of(17)
62+
63+
tasks["check"].dependsOn("spotlessCheck")
64+
}
65+
66+
spotless {
67+
kotlinGradle {
68+
ktlint()
69+
}
70+
}
71+
72+
tasks.register("format").get().dependsOn("spotlessApply")
73+
}
74+
75+
fun booleanEnv(envVar: String): Boolean? = System.getenv(envVar)?.toBoolean()
76+
77+
fun String.runCommand(): String {
78+
val proc =
79+
ProcessBuilder(*split(" ").toTypedArray())
80+
.redirectOutput(ProcessBuilder.Redirect.PIPE)
81+
.redirectError(ProcessBuilder.Redirect.INHERIT)
82+
.start()
83+
proc.waitFor(10, TimeUnit.SECONDS)
84+
return proc.inputStream.bufferedReader().readText()
85+
}

java/gradle.properties

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#org.gradle.configuration-cache=true
2+
org.gradle.parallel=true
3+
org.gradle.caching=true
4+
5+
# extra JVM args needed to allow Spotless to access JDK private classes.
6+
org.gradle.jvmargs =--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
7+
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
8+
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
9+
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
10+
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

java/gradle/libs.versions.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file was generated by the Gradle 'init' task.
2+
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
3+
4+
[versions]
5+
commons-math3 = "3.6.1"
6+
guava = "33.3.1-jre"
7+
spark = "3.5.4"
8+
9+
[libraries]
10+
commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" }
11+
guava = { module = "com.google.guava:guava", version.ref = "guava" }
12+
spark-catalyst = { module = "org.apache.spark:spark-catalyst_2.12", version.ref = "spark" }
13+
spark-sql = { module = "org.apache.spark:spark-sql_2.12", version.ref = "spark" }
42.6 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)