Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ public object KotlinNotebookPluginUtils {
val finalComparator = if (isDesc[0]) comparator.reversed() else comparator

val permutation = Array(column.size()) { it }
// parallelSort is thread-safe here: the comparator only performs concurrent reads from the column,
// and column.get() is a simple, side-effect-free access to an underlying List.
// Standard List implementations (ArrayList, etc.) are safe for concurrent reads
// as long as there are no concurrent modifications to the dataframe.
Arrays.parallelSort(permutation, finalComparator)
return SortedDataFrameView(df, permutation.asList())
}
Expand Down