Skip to content

Commit d81b986

Browse files
committed
Inproves README — adds information on collection of data from Dataset
Signed-off-by: Pasha Finkelshteyn <asm0dey@jetbrains.com>
1 parent 5c05b6f commit d81b986

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ withSpark {
123123

124124
Here we're showing cached `Dataset` for debugging purposes then filtering it. The `filter` method returns filtered `Dataset` and then the cached `Dataset` is being unpersisted, so we have more memory to call the `map` method and collect the resulting `Dataset`.
125125

126+
### `toList` and `toArray`
127+
128+
Kotlin uses `to` method on sequences to convert them to collections, so we have `toList` and `toArray` methods in our API for your code to look idiomatic. Usual `collect` method works too, but result should be casted to `Array` because `collect` returns Scala's array, which is not the same as Java/Kotlin one.
129+
126130
## Examples
127131

128132
For more, check out [examples](https://github.com/JetBrains/kotlin-spark-api/tree/master/examples/src/main/kotlin/org/jetbrains/spark/api/examples) module.

0 commit comments

Comments
 (0)