Split by operation on "normal classes" could be clearer
- Dominant language
- Kotlin
- Stars
- 1.1k
- Forks
- 83
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 30
Description
I was working with a `LocalDateTime` which I wanted to split up into a `LocalDate` and a `LocalTime` column. I found the `split` operation, but it wasn't immediately obvious how to work with this. For splitting a column up based on String delimiters, something like
```kotlin
df.split { stringCol }.by { it.split(",") }.into("first", "second")
```
is clear and works well. However, when trying to split up a `LocalDateTime`:
```kotlin
df.split { localDateTimeCol }.by { listOf(it.date, it.time) }.into("date", "time")
```
does not seem obvious.
Something like
```kotlin
df.split { localDateTimeCol }.by { it.date and it.time }.into("date", "time")
```
would improve it a bit, and
```kotlin
df.split { localDateTimeCol }.by {
it.date into "date"
it.time into "time"
}
```
even more.
(Btw, since `Split` is a `public data class`, you're able to call `df.split { myCol }.copy { }` which looks like it should be prohibited)
Contributor guide
Assessment
This issue has not been assessed yet.