File tree 6 files changed +11
-4
lines changed
src/main/scala/org/jetbrains/spark/extensions
src/main/kotlin/org/jetbrains/spark/api
6 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 4
4
<parent >
5
5
<artifactId >kotlin-spark-api-parent</artifactId >
6
6
<groupId >org.jetbrains.kotlin.spark</groupId >
7
- <version >0.2.0 </version >
7
+ <version >0.2.1 </version >
8
8
</parent >
9
9
<artifactId >core</artifactId >
10
10
<name >Kotlin Spark API: Scala core</name >
Original file line number Diff line number Diff line change 19
19
*/
20
20
package org .jetbrains .spark .extensions
21
21
22
+ import org .apache .spark .SparkContext
22
23
import org .apache .spark .sql ._
23
24
24
25
object KSparkExtensions {
@@ -37,4 +38,6 @@ object KSparkExtensions {
37
38
import org .apache .spark .sql .execution .debug ._
38
39
df.debug()
39
40
}
41
+
42
+ def sparkContext (s: SparkSession ): SparkContext = s.sparkContext
40
43
}
Original file line number Diff line number Diff line change 7
7
<parent >
8
8
<artifactId >kotlin-spark-api-parent</artifactId >
9
9
<groupId >org.jetbrains.kotlin.spark</groupId >
10
- <version >0.2.0 </version >
10
+ <version >0.2.1 </version >
11
11
</parent >
12
12
13
13
<groupId >org.jetbrains.kotlin.spark.examples</groupId >
Original file line number Diff line number Diff line change 7
7
<parent >
8
8
<artifactId >kotlin-spark-api-parent</artifactId >
9
9
<groupId >org.jetbrains.kotlin.spark</groupId >
10
- <version >0.2.0 </version >
10
+ <version >0.2.1 </version >
11
11
</parent >
12
12
13
13
<artifactId >kotlin-spark-api</artifactId >
Original file line number Diff line number Diff line change 21
21
22
22
package org.jetbrains.spark.api
23
23
24
+ import org.apache.spark.SparkContext
24
25
import org.apache.spark.api.java.function.*
25
26
import org.apache.spark.sql.*
26
27
import org.apache.spark.sql.Encoders.*
@@ -141,6 +142,9 @@ inline fun <reified T> Dataset<T>.forEach(noinline func: (T) -> Unit) = foreach(
141
142
*/
142
143
fun <T > Dataset<T>.debugCodegen () = also { KSparkExtensions .debugCodegen(it) }
143
144
145
+ val SparkSession .sparkContext
146
+ get() = KSparkExtensions .sparkContext(this )
147
+
144
148
/* *
145
149
* It's hard to call `Dataset.debug` from kotlin, so here is utility for that
146
150
*/
Original file line number Diff line number Diff line change 4
4
<modelVersion >4.0.0</modelVersion >
5
5
<groupId >org.jetbrains.kotlin.spark</groupId >
6
6
<artifactId >kotlin-spark-api-parent</artifactId >
7
- <version >0.2.0 </version >
7
+ <version >0.2.1 </version >
8
8
<name >kotlin-spark-api-parent</name >
9
9
<url >http://maven.apache.org</url >
10
10
<packaging >pom</packaging >
You can’t perform that action at this time.
0 commit comments