Skip to content

Commit 756a161

Browse files
authored
Merge pull request #188 from Kotlin/main
1.2.2 release
2 parents 91605b1 + f309ed9 commit 756a161

File tree

14 files changed

+85
-59
lines changed

14 files changed

+85
-59
lines changed

.github/workflows/build.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ jobs:
1010
build-all-versions:
1111
strategy:
1212
matrix:
13-
scala: [ "2.12.16", "2.13.8" ]
14-
spark: [ "3.3.0", "3.2.1", "3.2.0", "3.1.3", "3.1.2", "3.1.1", "3.1.0", "3.0.3", "3.0.2", "3.0.1", "3.0.0" ]
13+
scala: [ "2.12.17", "2.13.10" ]
14+
spark: [ "3.3.1", "3.3.0", "3.2.3", "3.2.2", "3.2.1", "3.2.0", "3.1.3", "3.1.2", "3.1.1", "3.1.0", "3.0.3", "3.0.2", "3.0.1", "3.0.0" ]
1515
exclude:
16-
- scala: "2.13.8"
16+
- scala: "2.13.10"
1717
spark: "3.1.3"
18-
- scala: "2.13.8"
18+
- scala: "2.13.10"
1919
spark: "3.1.2"
20-
- scala: "2.13.8"
20+
- scala: "2.13.10"
2121
spark: "3.1.1"
22-
- scala: "2.13.8"
22+
- scala: "2.13.10"
2323
spark: "3.1.0"
24-
- scala: "2.13.8"
24+
- scala: "2.13.10"
2525
spark: "3.0.3"
26-
- scala: "2.13.8"
26+
- scala: "2.13.10"
2727
spark: "3.0.2"
28-
- scala: "2.13.8"
28+
- scala: "2.13.10"
2929
spark: "3.0.1"
30-
- scala: "2.13.8"
30+
- scala: "2.13.10"
3131
spark: "3.0.0"
3232
runs-on: ubuntu-latest
3333

.github/workflows/publish_dev_version.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ jobs:
99
build-and-deploy:
1010
strategy:
1111
matrix:
12-
scala: [ "2.12.16", "2.13.8" ]
13-
spark: [ "3.3.0", "3.2.1", "3.2.0", "3.1.3", "3.1.2", "3.1.1", "3.1.0", "3.0.3", "3.0.2", "3.0.1", "3.0.0" ]
12+
scala: [ "2.12.17", "2.13.10" ]
13+
spark: [ "3.3.1", "3.3.0", "3.2.3", "3.2.2", "3.2.1", "3.2.0", "3.1.3", "3.1.2", "3.1.1", "3.1.0", "3.0.3", "3.0.2", "3.0.1", "3.0.0" ]
1414
exclude:
15-
- scala: "2.13.8"
15+
- scala: "2.13.10"
1616
spark: "3.1.3"
17-
- scala: "2.13.8"
17+
- scala: "2.13.10"
1818
spark: "3.1.2"
19-
- scala: "2.13.8"
19+
- scala: "2.13.10"
2020
spark: "3.1.1"
21-
- scala: "2.13.8"
21+
- scala: "2.13.10"
2222
spark: "3.1.0"
23-
- scala: "2.13.8"
23+
- scala: "2.13.10"
2424
spark: "3.0.3"
25-
- scala: "2.13.8"
25+
- scala: "2.13.10"
2626
spark: "3.0.2"
27-
- scala: "2.13.8"
27+
- scala: "2.13.10"
2828
spark: "3.0.1"
29-
- scala: "2.13.8"
29+
- scala: "2.13.10"
3030
spark: "3.0.0"
3131
runs-on: ubuntu-latest
3232
permissions:
@@ -72,7 +72,7 @@ jobs:
7272
./gradlew
7373
-Pspark=${{ matrix.spark }}
7474
-Pscala=${{ matrix.scala }}
75-
-PskipScalaTuplesInKotlin=${{ !(matrix.spark == '3.0.0' || matrix.scala == '2.13.8' && matrix.spark == '3.2.0') }}
75+
-PskipScalaTuplesInKotlin=${{ !(matrix.spark == '3.0.0' || matrix.scala == '2.13.10' && matrix.spark == '3.2.0') }}
7676
clean
7777
publishMavenPublicationToGitHubPackagesRepository
7878
--scan

.github/workflows/publish_release_version.yml

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
name: Deploy release version to Maven Central
22

33
on:
4-
# release: TODO temporary, to see if push to maven central works
5-
# types: [created]
6-
push:
7-
branches:
8-
- "release"
4+
release:
5+
types: [created]
96

107
jobs:
118
build-and-deploy-mvn-central:
129
strategy:
1310
matrix:
14-
scala: [ "2.12.16", "2.13.8" ]
15-
spark: [ "3.3.0", "3.2.1", "3.2.0", "3.1.3", "3.1.2", "3.1.1", "3.1.0", "3.0.3", "3.0.2", "3.0.1", "3.0.0" ]
11+
scala: [ "2.12.17", "2.13.10" ]
12+
spark: [ "3.3.1", "3.3.0", "3.2.3", "3.2.2", "3.2.1", "3.2.0", "3.1.3", "3.1.2", "3.1.1", "3.1.0", "3.0.3", "3.0.2", "3.0.1", "3.0.0" ]
1613
exclude:
17-
- scala: "2.13.8"
14+
- scala: "2.13.10"
1815
spark: "3.1.3"
19-
- scala: "2.13.8"
16+
- scala: "2.13.10"
2017
spark: "3.1.2"
21-
- scala: "2.13.8"
18+
- scala: "2.13.10"
2219
spark: "3.1.1"
23-
- scala: "2.13.8"
20+
- scala: "2.13.10"
2421
spark: "3.1.0"
25-
- scala: "2.13.8"
22+
- scala: "2.13.10"
2623
spark: "3.0.3"
27-
- scala: "2.13.8"
24+
- scala: "2.13.10"
2825
spark: "3.0.2"
29-
- scala: "2.13.8"
26+
- scala: "2.13.10"
3027
spark: "3.0.1"
31-
- scala: "2.13.8"
28+
- scala: "2.13.10"
3229
spark: "3.0.0"
3330
runs-on: ubuntu-latest
3431
permissions:
@@ -77,7 +74,7 @@ jobs:
7774
./gradlew
7875
-Pspark=${{ matrix.spark }}
7976
-Pscala=${{ matrix.scala }}
80-
-PskipScalaTuplesInKotlin=${{ !(matrix.spark == '3.0.0' || matrix.scala == '2.13.8' && matrix.spark == '3.2.0') }}
77+
-PskipScalaTuplesInKotlin=${{ !(matrix.spark == '3.0.0' || matrix.scala == '2.13.10' && matrix.spark == '3.2.0') }}
8178
clean
8279
publishMavenPublicationToMavenCentralRepository
8380
--scan

README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Kotlin Stable](https://kotl.in/badges/stable.svg)](https://kotlinlang.org/docs/components-stability.html)
44
[![JetBrains official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
5-
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx.spark/kotlin-spark-api_3.3.0_2.13.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:"org.jetbrains.kotlinx.spark"%20AND%20a:"kotlin-spark-api_3.3.0_2.13")
5+
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx.spark/kotlin-spark-api_3.3.1_2.13.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:"org.jetbrains.kotlinx.spark"%20AND%20a:"kotlin-spark-api_3.3.1_2.13")
66
[![Join the chat at https://gitter.im/JetBrains/kotlin-spark-api](https://badges.gitter.im/JetBrains/kotlin-spark-api.svg)](https://gitter.im/JetBrains/kotlin-spark-api?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
77

88
Your next API to work with [Apache Spark](https://spark.apache.org/).
@@ -38,8 +38,14 @@ We have opened a Spark Project Improvement Proposal: [Kotlin support for Apache
3838

3939
| Apache Spark | Scala | Kotlin for Apache Spark |
4040
|:------------:|:-----:|:-----------------------------------:|
41+
| 3.3.1 | 2.13 | kotlin-spark-api_3.3.1_2.13:VERSION |
42+
| | 2.12 | kotlin-spark-api_3.3.1_2.12:VERSION |
4143
| 3.3.0 | 2.13 | kotlin-spark-api_3.3.0_2.13:VERSION |
4244
| | 2.12 | kotlin-spark-api_3.3.0_2.12:VERSION |
45+
| 3.2.3 | 2.13 | kotlin-spark-api_3.2.3_2.13:VERSION |
46+
| | 2.12 | kotlin-spark-api_3.2.3_2.12:VERSION |
47+
| 3.2.2 | 2.13 | kotlin-spark-api_3.2.2_2.13:VERSION |
48+
| | 2.12 | kotlin-spark-api_3.2.2_2.12:VERSION |
4349
| 3.2.1 | 2.13 | kotlin-spark-api_3.2.1_2.13:VERSION |
4450
| | 2.12 | kotlin-spark-api_3.2.1_2.12:VERSION |
4551
| 3.2.0 | 2.13 | kotlin-spark-api_3.2.0_2.13:VERSION |
@@ -67,7 +73,7 @@ The Kotlin for Spark artifacts adhere to the following convention:
6773
The only exception to this is `scala-tuples-in-kotlin_[Scala core version]:[Kotlin for Apache Spark API version]`, which is
6874
independent of Spark.
6975

70-
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx.spark/kotlin-spark-api_3.3.0_2.13.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:"org.jetbrains.kotlinx.spark"%20AND%20a:"kotlin-spark-api_3.3.0_2.13")
76+
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx.spark/kotlin-spark-api_3.3.1_2.13.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:"org.jetbrains.kotlinx.spark"%20AND%20a:"kotlin-spark-api_3.3.1_2.13")
7177

7278
## How to configure Kotlin for Apache Spark in your project
7379

@@ -78,7 +84,7 @@ Here's an example `pom.xml`:
7884
```xml
7985
<dependency>
8086
<groupId>org.jetbrains.kotlinx.spark</groupId>
81-
<artifactId>kotlin-spark-api_3.3.0_2.13</artifactId>
87+
<artifactId>kotlin-spark-api_3.3.1_2.13</artifactId>
8288
<version>${kotlin-spark-api.version}</version>
8389
</dependency>
8490
<dependency>
@@ -111,7 +117,7 @@ To it, simply add
111117
to the top of your notebook. This will get the latest version of the API, together with the latest version of Spark.
112118
To define a certain version of Spark or the API itself, simply add it like this:
113119
```jupyterpython
114-
%use spark(spark=3.3.0, scala=2.13, v=1.2.0)
120+
%use spark(spark=3.3.1, scala=2.13, v=1.2.2)
115121
```
116122

117123
Inside the notebook a Spark session will be initiated automatically. This can be accessed via the `spark` value.

buildSrc/src/main/kotlin/Dependencies.kt

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ object Dependencies {
2020
inline val kotlinTest get() = "org.jetbrains.kotlin:kotlin-test:${Versions.kotlin}"
2121
inline val kotlinScriptingCommon get() = "org.jetbrains.kotlin:kotlin-scripting-common"
2222
inline val kotlinScriptingJvm get() = "org.jetbrains.kotlin:kotlin-scripting-jvm"
23+
inline val jacksonDatabind get() = "com.fasterxml.jackson.core:jackson-databind:${Versions.jacksonDatabind}"
2324
}
2425

2526

buildSrc/src/main/kotlin/Versions.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object Versions {
2-
const val project = "1.2.1"
2+
const val project = "1.2.2-SNAPSHOT"
33
const val groupID = "org.jetbrains.kotlinx.spark"
4-
const val kotlin = "1.7.10"
4+
const val kotlin = "1.7.20"
55
const val jvmTarget = "11"
66

77
inline val spark get() = System.getProperty("spark") as String
@@ -21,6 +21,7 @@ object Versions {
2121
const val hadoop = "3.3.1"
2222
const val kotlinxHtml = "0.7.5"
2323
const val klaxon = "5.5"
24+
const val jacksonDatabind = "2.13.4.2"
2425

2526
inline val versionMap
2627
get() = mapOf(

core/build.gradle.kts

+11-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ dependencies {
2626
reflect,
2727
)
2828

29+
// https://github.com/FasterXML/jackson-bom/issues/52
30+
if (Versions.spark == "3.3.1") implementation(jacksonDatabind)
31+
2932
implementation(
3033
sparkSql,
3134
)
@@ -35,14 +38,18 @@ dependencies {
3538

3639
java {
3740
toolchain {
38-
languageVersion.set(
39-
JavaLanguageVersion.of(Versions.jvmTarget)
40-
)
41+
if (Versions.scalaCompat.toDouble() > 2.12) { // scala 2.12 will always target java 8
42+
languageVersion.set(
43+
JavaLanguageVersion.of(Versions.jvmTarget)
44+
)
45+
}
4146
}
4247
}
4348

4449
tasks.withType<ScalaCompile> {
45-
targetCompatibility = Versions.jvmTarget
50+
if (Versions.scalaCompat.toDouble() > 2.12) { // scala 2.12 will always target java 8
51+
targetCompatibility = Versions.jvmTarget
52+
}
4653
}
4754

4855
val scalaMainSources = sourceSets.main.get().scala.sourceDirectories

docs/quick-start-guide.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ Here's what the `pom.xml` looks like for this example:
7272
</dependency>
7373
<dependency> <!-- Kotlin Spark API dependency -->
7474
<groupId>org.jetbrains.kotlinx.spark</groupId>
75-
<artifactId>kotlin-spark-api-3.0.0_2.12</artifactId>
76-
<version>1.0.1</version>
75+
<artifactId>kotlin-spark-api_3.3.1_2.13</artifactId>
76+
<version>1.2.2</version>
7777
</dependency>
7878
<dependency> <!-- Spark dependency -->
7979
<groupId>org.apache.spark</groupId>
8080
<artifactId>spark-sql_2.12</artifactId>
81-
<version>3.0.0</version>
81+
<version>3.3.1</version>
8282
</dependency>
8383
</dependencies>
8484

@@ -163,8 +163,8 @@ dependencies {
163163
// Kotlin stdlib
164164
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.0'
165165
// Kotlin Spark API
166-
implementation 'org.jetbrains.kotlinx.spark:kotlin-spark-api-3.0.0_2.12:1.0.1' // Apache Spark
167-
compileOnly 'org.apache.spark:spark-sql_2.12:3.0.0'
166+
implementation 'org.jetbrains.kotlinx.spark:kotlin-spark-api_3.3.1_2.13:1.2.2' // Apache Spark
167+
compileOnly 'org.apache.spark:spark-sql_2.12:3.3.1'
168168
}
169169
170170
compileKotlin {
@@ -198,9 +198,9 @@ dependencies {
198198
// Kotlin stdlib
199199
implementation ("org.jetbrains.kotlin:kotlin-stdlib:1.4.0")
200200
// Kotlin Spark API
201-
implementation ("org.jetbrains.kotlinx.spark:kotlin-spark-api-3.0.0_2.12:1.0.1")
201+
implementation ("org.jetbrains.kotlinx.spark:kotlin-spark-api_3.3.1_2.13:1.2.2")
202202
// Apache Spark
203-
compileOnly ("org.apache.spark:spark-sql_2.12:3.0.0")
203+
compileOnly ("org.apache.spark:spark-sql_2.12:3.3.1")
204204
}
205205
206206
compileKotlin.kotlinOptions.jvmTarget = "1.8"

examples/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ dependencies {
2121
}
2222

2323
with(Dependencies) {
24+
25+
// https://github.com/FasterXML/jackson-bom/issues/52
26+
if (Versions.spark == "3.3.1") implementation(jacksonDatabind)
27+
2428
implementation(
2529
sparkSql,
2630
sparkMl,

gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ GROUP=org.jetbrains.kotlinx.spark
77

88
# Controls the spark and scala version for the entire project
99
# can also be defined like ./gradlew -Pspark=X.X.X -Pscala=X.X.X build
10-
spark=3.3.0
11-
scala=2.13.8
12-
#scala=2.12.16
10+
spark=3.3.1
11+
scala=2.13.10
12+
# scala=2.12.17
1313
skipScalaTuplesInKotlin=false
1414

1515
org.gradle.caching=true
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

jupyter/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ dependencies {
4343
}
4444

4545
with(Dependencies) {
46+
47+
// https://github.com/FasterXML/jackson-bom/issues/52
48+
if (Versions.spark == "3.3.1") implementation(jacksonDatabind)
49+
4650
api(
4751
kotlinxHtml,
4852
sparkSql,

kotlin-spark-api/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ dependencies {
3535
}
3636

3737
with(Dependencies) {
38+
39+
// https://github.com/FasterXML/jackson-bom/issues/52
40+
if (Versions.spark == "3.3.1") implementation(jacksonDatabind)
41+
3842
implementation(
3943
kotlinStdLib,
4044
reflect,

kotlin-spark-api/src/main/kotlin/org/jetbrains/kotlinx/spark/api/Encoding.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import scala.Product
3939
import scala.reflect.ClassTag
4040
import java.beans.PropertyDescriptor
4141
import java.math.BigDecimal
42+
import java.math.BigInteger
4243
import java.sql.Date
4344
import java.sql.Timestamp
4445
import java.time.*
@@ -119,6 +120,7 @@ private val knownDataTypes: Map<KClass<out Any>, DataType> = mapOf(
119120
ByteArray::class to DataTypes.BinaryType,
120121
Decimal::class to DecimalType.SYSTEM_DEFAULT(),
121122
BigDecimal::class to DecimalType.SYSTEM_DEFAULT(),
123+
BigInteger::class to DecimalType.SYSTEM_DEFAULT(),
122124
CalendarInterval::class to DataTypes.CalendarIntervalType,
123125
)
124126

@@ -234,7 +236,7 @@ fun schema(type: KType, map: Map<String, KType> = mapOf()): DataType {
234236
)
235237
}
236238

237-
klass.isSubclassOf(Map::class) -> {
239+
klass == Map::class -> {
238240
val mapKeyParam = types.getValue(klass.typeParameters[0].name)
239241
val mapValueParam = types.getValue(klass.typeParameters[1].name)
240242

0 commit comments

Comments
 (0)