Skip to content

Commit

Permalink
feat: review Comments
Browse files Browse the repository at this point in the history
Address the review comments

Also adjusted the build so it was connected to the main top level build
(resulted in removing quite a bit of the gradle build that really wasn't needed here)

Converted to Kotlin format (hopefully corectly)

Signed-off-by: MBWhite <[email protected]>
  • Loading branch information
mbwhite committed Sep 23, 2024
1 parent d7ea257 commit 8e26144
Show file tree
Hide file tree
Showing 27 changed files with 121 additions and 591 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ out/**
*.iws
.vscode
.pmdCache

*/bin
2 changes: 2 additions & 0 deletions examples/substrait-spark/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
spark-warehouse
derby.log
_apps
_data
5 changes: 2 additions & 3 deletions examples/substrait-spark/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Introduction to the Substrait-Spark library

The Substrait-Spark library was recently added to the [substrait-java](https://github.com/substrait-io/substrait-java) project; this library allows Substrait plans to convert to and from Spark Plans.

The Substrait-Spark library allows Substrait plans to convert to and from Spark Plans. This example will show how this can be used.

## How does this work in practice?

Expand All @@ -27,7 +26,7 @@ To run these you will need:
- Java 17 or greater
- Docker to start a test Spark Cluster
- you could use your own cluster, but would need to adjust file locations defined in [SparkHelper](./app/src/main/java/io/substrait/examples/SparkHelper.java)
- [just task runner](https://github.com/casey/just#installation) optional, but very helpful to run the bash commands
- The [just task runner](https://github.com/casey/just#installation) is optional, but very helpful to run the bash commands
- [Two datafiles](./app/src/main/resources/) are provided (CSV format)

For building using the `substrait-spark` library youself, using the [mvn repository](https://mvnrepository.com/artifact/io.substrait/spark)
Expand Down
2 changes: 0 additions & 2 deletions examples/substrait-spark/app/.gitignore

This file was deleted.

62 changes: 0 additions & 62 deletions examples/substrait-spark/app/build.gradle

This file was deleted.

16 changes: 0 additions & 16 deletions examples/substrait-spark/build-logic/build.gradle

This file was deleted.

15 changes: 0 additions & 15 deletions examples/substrait-spark/build-logic/settings.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

48 changes: 48 additions & 0 deletions examples/substrait-spark/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id("java")
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

dependencies {
implementation("org.apache.spark:spark-core_2.12:3.5.1")
implementation("io.substrait:spark:0.36.0")
implementation("io.substrait:core:0.36.0")
implementation("org.apache.spark:spark-sql_2.12:3.5.1")

// For a real Spark application, these would not be required since they would be in the Spark server classpath
runtimeOnly("org.apache.spark:spark-core_2.12:3.5.1")
runtimeOnly("org.apache.spark:spark-hive_2.12:3.5.1")

}

tasks.jar {
isZip64 = true
exclude ("META-INF/*.RSA")
exclude ("META-INF/*.SF")
exclude ("META-INF/*.DSA")

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest.attributes["Main-Class"] = "io.substrait.examples.App"
from(configurations.runtimeClasspath.get().map({ if (it.isDirectory) it else zipTree(it) }))

}

tasks.named<Test>("test") {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
java {
toolchain { languageVersion.set(JavaLanguageVersion.of(17)) }
}
// // Apply a specific Java toolchain to ease working on different environments.
// java {
// toolchain {
// languageVersion = JavaLanguageVersion.of(17)
// }
// }
6 changes: 0 additions & 6 deletions examples/substrait-spark/gradle.properties

This file was deleted.

14 changes: 0 additions & 14 deletions examples/substrait-spark/gradle/libs.versions.toml

This file was deleted.

Binary file not shown.

This file was deleted.

Loading

0 comments on commit 8e26144

Please sign in to comment.