Skip to content

Conversation

@Jolanrensen
Copy link
Collaborator

Just a couple of small things I came across while working with the library.

Firstly, dataset.foreachPartition { } has overload resolution ambiguity, so I added forEachPartition {} to the API.

Secondly, some functions (like reduceGroups()) return a Dataset<Pair<K, V>>, or the user creates a key/value like dataset themselves and then it might be useful to just take the keys or the values (I know I found it useful).
So I added takeKeys() and takeValues() for Dataset<Pair>, Dataset<Tuple2>, and Dataset<Arity2>. It's a small thing, but might improve readability.

Lastly, just like getting the columns using property references, it might also be useful to sort datasets using those, so I added the ability to do:

val sorted: Dataset<YourClass> = unsorted.sort(YourClass::a)
val sorted2: Dataset<YourClass> = unsorted.sort(YourClass::a, YourClass::b)

@asm0dey let me know if these are helpful :)

…value like datasets, and added property ref based sort function for Datasets
@asm0dey asm0dey merged commit 0db795c into Kotlin:main Jun 28, 2021
asm0dey pushed a commit that referenced this pull request Jun 28, 2021
…key/value like datasets, and added property ref based sort function for Datasets (#91)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants