Skip to content

Commit 08f8259

Browse files
committed
updating examples and deprecations for qodana
1 parent 7862da2 commit 08f8259

File tree

6 files changed

+56
-57
lines changed

6 files changed

+56
-57
lines changed

examples/src/main/kotlin/org/jetbrains/kotlinx/spark/examples/CachedOperations.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ fun main() {
3131

3232
filter { it._1 % 2 == 0 }.showDS()
3333
}
34-
.map { (first, second) ->
35-
first X second X (first + second) * 2
36-
}
34+
.map { it.appendedBy(it._1 + it._2 * 2) }
3735
.show()
3836
}
3937
}

examples/src/main/kotlin/org/jetbrains/kotlinx/spark/examples/Group.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ package org.jetbrains.kotlinx.spark.examples
2121

2222
import org.jetbrains.kotlinx.spark.api.*
2323
import org.jetbrains.kotlinx.spark.api.tuples.*
24-
import org.jetbrains.kotlinx.spark.api.tuples.t
2524

2625
fun main() {
2726
withSpark {
@@ -31,7 +30,9 @@ fun main() {
3130
2 X "c",
3231
)
3332
.groupByKey { it._1 }
34-
.reduceGroupsK { a, b -> tupleOf(_1 = a._1 + b._1, _2 = a._2 + b._2) }
33+
.reduceGroupsK { a, b ->
34+
tupleOf(a._1 + b._1, a._2 + b._2)
35+
}
3536
.show()
3637
}
3738
}

examples/src/main/kotlin/org/jetbrains/kotlinx/spark/examples/Main.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ object Main {
4444
Q(3, 3 X "333"),
4545
)
4646
)
47-
.map { (a, b) -> t(_1 = a + b._1, _2 = b._2?.length) }
47+
.map { (a, b) -> t(a + b._1, b._2?.length) }
4848
.map { it: Tuple2<Int, Int?> -> it + 1 } // add counter
4949

5050
val pairs = spark

examples/src/main/kotlin/org/jetbrains/kotlinx/spark/examples/MapAndListOperations.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fun main() {
3030
)
3131
.flatMap {
3232
it.toList()
33-
.map { (first, tuple) -> listOf(first, tuple._1, tuple._2, tuple._3) }
33+
.map { (first, tuple) -> (first + tuple).toList() }
3434
.iterator()
3535
}
3636
.flatten()

0 commit comments

Comments
 (0)