-
Notifications
You must be signed in to change notification settings - Fork 36
Adds Kotlin Jupyter notebook support #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 35 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
f94c3d8
testing jupyter
Jolanrensen 4f68d06
fixed instant tests
Jolanrensen 8d038a5
attempting to make it work
Jolanrensen d5c0b32
basics work!
Jolanrensen e9f4b35
updating readme
Jolanrensen 34a0cbd
added dataset html renderer, trying to fix library issues
Jolanrensen 1104a64
fixed import
Jolanrensen b907213
added dataset renderer with nice css, jupyter test still broken
Jolanrensen f026f57
attempting to make jupyter test work
Jolanrensen 8071758
added simple RDD rendering
Jolanrensen ac9b6d1
jupyter tests work when targeting jdk 11
Jolanrensen a6336f4
more tests and trying to please qodana
Jolanrensen a91d35b
more tests and trying to please qodana
Jolanrensen f346c3b
added more tests and catches for RDDs that cannot be rendered
Jolanrensen fd19408
updated readme
Jolanrensen ee38db2
Merge branch 'spark-3.2' into jupyter-test
Jolanrensen 717501a
adding qodana scan to github actions. Improved tuple and rdd render s…
Jolanrensen 61da8de
Merge branch 'spark-3.2' into jupyter-test
Jolanrensen 33ad506
updated from main branch
Jolanrensen ea59d66
maybe fixed kotest?
Jolanrensen 41e959e
adding test for filter function of dataset of local data class and ot…
Jolanrensen 90df422
now able to debug right test
Jolanrensen dfb48df
now able to debug right test
Jolanrensen 390defc
added functions to integration since json will support different inte…
Jolanrensen 32a54f8
added functions to integration since json will support different inte…
Jolanrensen a0cf372
temp test to see if we can publish to gh packages from a branch
Jolanrensen 4e9e05a
temp test to see if we can publish to gh packages from a branch
Jolanrensen bf119be
temp test to see if we can publish to gh packages from a branch
Jolanrensen 8c84471
temp test to see if we can publish to gh packages from a branch
Jolanrensen 2fb01c3
enabling snappy setting for lz4 compression codec
Jolanrensen b7c9297
jupyter api allows multiple integration files now
Jolanrensen 10c3a90
This build will fail. Requires mavenLocal build of kotlin jupyter wit…
Jolanrensen 5009355
Updated kotlin jupyter version, added streaming test for jupyter as well
Jolanrensen 0be6b70
removed snappy again
Jolanrensen 84bf0d5
fixed gh actions
Jolanrensen 2b6aca4
some cleaning per request
Jolanrensen 52398d6
split off jupyter into a separate module
Jolanrensen 81448ee
gh actions deploying is working, so setting correct branch
Jolanrensen 7c2d652
fixed dependencies as requested
Jolanrensen 234430d
moved nexus plugin to release sign, which was renamed to central-deploy
Jolanrensen e8f4ee4
disabled qodana...
Jolanrensen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Generate and publish docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- "jupyter-test" # TODO change to spark-3.2 | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
distributions: adopt | ||
java-version: 11 | ||
check-latest: true | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Deploy to GH Packages | ||
run: ./mvnw --batch-mode deploy -Dkotest.tags="!Kafka" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,114 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<name>Kotlin Spark API: Examples for Spark 3.2+ (Scala 2.12)</name> | ||
<description>Example of usage</description> | ||
<artifactId>examples-3.2_2.12</artifactId> | ||
<parent> | ||
<groupId>org.jetbrains.kotlinx.spark</groupId> | ||
<artifactId>kotlin-spark-api-parent_2.12</artifactId> | ||
<version>1.0.4-SNAPSHOT</version> | ||
<relativePath>../pom_2.12.xml</relativePath> | ||
</parent> | ||
<name>Kotlin Spark API: Examples for Spark 3.2+ (Scala 2.12)</name> | ||
<description>Example of usage</description> | ||
<artifactId>examples-3.2_2.12</artifactId> | ||
<parent> | ||
<groupId>org.jetbrains.kotlinx.spark</groupId> | ||
<artifactId>kotlin-spark-api-parent_2.12</artifactId> | ||
<version>1.0.4-SNAPSHOT</version> | ||
<relativePath>../pom_2.12.xml</relativePath> | ||
</parent> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlinx.spark</groupId> | ||
<artifactId>kotlin-spark-api-3.2</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.spark</groupId> | ||
<artifactId>spark-sql_${scala.compat.version}</artifactId> | ||
<version>${spark3.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.spark</groupId> | ||
<artifactId>spark-streaming_${scala.compat.version}</artifactId> | ||
<version>${spark3.version}</version> | ||
</dependency> | ||
<dependency><!-- Only needed for Qodana --> | ||
<groupId>org.apache.spark</groupId> | ||
<artifactId>spark-streaming-kafka-0-10_${scala.compat.version}</artifactId> | ||
<version>${spark3.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-reflect</artifactId> | ||
</dependency><!-- TODO this shouldn't be needed --> | ||
Jolanrensen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<dependency> | ||
<groupId>org.jetbrains.kotlinx.spark</groupId> | ||
<artifactId>kotlin-spark-api-3.2</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.spark</groupId> | ||
<artifactId>spark-sql_${scala.compat.version}</artifactId> | ||
<version>${spark3.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.spark</groupId> | ||
<artifactId>spark-streaming_${scala.compat.version}</artifactId> | ||
<version>${spark3.version}</version> | ||
</dependency> | ||
<dependency><!-- Only needed for Qodana --> | ||
<groupId>org.apache.spark</groupId> | ||
<artifactId>spark-streaming-kafka-0-10_${scala.compat.version}</artifactId> | ||
<version>${spark3.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<sourceDirectory>src/main/kotlin</sourceDirectory> | ||
<testSourceDirectory>src/test/kotlin</testSourceDirectory> | ||
<directory>target/3.2/${scala.compat.version}</directory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>compile</id> | ||
<goals> | ||
<goal>compile</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>test-compile</id> | ||
<goals> | ||
<goal>test-compile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>${maven-assembly-plugin.version}</version> | ||
<configuration> | ||
<descriptorRefs> | ||
<descriptorRef>jar-with-dependencies</descriptorRef> | ||
</descriptorRefs> | ||
<archive> | ||
<manifest> | ||
<mainClass>org.jetbrains.spark.api.examples.WordCountKt</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.sonatype.plugins</groupId> | ||
<artifactId>nexus-staging-maven-plugin</artifactId> | ||
<configuration> | ||
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>8</source> | ||
<target>8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<build> | ||
<sourceDirectory>src/main/kotlin</sourceDirectory> | ||
<testSourceDirectory>src/test/kotlin</testSourceDirectory> | ||
<directory>target/3.2/${scala.compat.version}</directory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>compile</id> | ||
<goals> | ||
<goal>compile</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>test-compile</id> | ||
<goals> | ||
<goal>test-compile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>${maven-assembly-plugin.version}</version> | ||
<configuration> | ||
<descriptorRefs> | ||
<descriptorRef>jar-with-dependencies</descriptorRef> | ||
</descriptorRefs> | ||
<archive> | ||
<manifest> | ||
<mainClass>org.jetbrains.spark.api.examples.WordCountKt</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.sonatype.plugins</groupId> | ||
<artifactId>nexus-staging-maven-plugin</artifactId> | ||
<configuration> | ||
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>${maven-compiler-plugin.version}</version> | ||
<configuration> | ||
<source>9</source> | ||
<target>9</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"description": "Kotlin for Apache® Spark™", | ||
"properties": { | ||
"spark": "3.2", | ||
"v": "2.0.0" | ||
}, | ||
"link": "https://github.com/JetBrains/kotlin-spark-api", | ||
"dependencies": [ | ||
"org.jetbrains.kotlinx.spark:kotlin-spark-api-$spark:$v" | ||
], | ||
"init": [ | ||
"%dumpClassesForSpark" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"description": "Kotlin for Apache® Spark™", | ||
"properties": { | ||
"spark": "3.2", | ||
"v": "2.0.0" | ||
}, | ||
"link": "https://github.com/JetBrains/kotlin-spark-api", | ||
"dependencies": [ | ||
"org.jetbrains.kotlinx.spark:kotlin-spark-api-$spark:$v" | ||
], | ||
"init": [ | ||
"%dumpClassesForSpark", | ||
asm0dey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"val spark = org.jetbrains.kotlinx.spark.api.SparkSession.builder().master(SparkConf().get(\"spark.master\", \"local[*]\")).appName(\"Jupyter\").getOrCreate()", | ||
"spark.sparkContext.setLogLevel(org.jetbrains.kotlinx.spark.api.SparkLogLevel.ERROR)", | ||
"val sc by lazy { org.apache.spark.api.java.JavaSparkContext(spark.sparkContext) }", | ||
"println(\"Spark session has been started and is running. No `withSpark { }` necessary, you can access `spark` and `sc` directly. To use Spark streaming, use `%use kotlin-spark-api-streaming` instead.\")", | ||
|
||
"inline fun <reified T> List<T>.toDS(): Dataset<T> = toDS(spark)", | ||
"inline fun <reified T> Array<T>.toDS(): Dataset<T> = spark.dsOf(*this)", | ||
"inline fun <reified T> dsOf(vararg arg: T): Dataset<T> = spark.dsOf(*arg)", | ||
"inline fun <reified T> RDD<T>.toDS(): Dataset<T> = toDS(spark)", | ||
"inline fun <reified T> JavaRDDLike<T, *>.toDS(): Dataset<T> = toDS(spark)", | ||
"inline fun <reified T> RDD<T>.toDF(): Dataset<Row> = toDF(spark)", | ||
"inline fun <reified T> JavaRDDLike<T, *>.toDF(): Dataset<Row> = toDF(spark)", | ||
"val udf: UDFRegistration get() = spark.udf()" | ||
], | ||
"shutdown": [ | ||
"spark.stop()" | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.