Skip to content

Commit

Permalink
parallel execution for columns serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Dec 3, 2023
1 parent b306bb4 commit e1f054e
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,13 @@ object RowSet {
var i = 0
val columnSize = schema.length
val sw1 = StopWatch.createStarted()
sw1.suspend()
val sw2 = StopWatch.createStarted()
sw2.suspend()
while (i < columnSize) {
sw1.resume()
val field = schema(i)
sw1.suspend()

sw2.resume()
val tColumn = toTColumn(rows, i, field.dataType)
sw2.suspend()
tRowSet.addToColumns(tColumn)
i += 1
(0 until columnSize).par.map { ordinal =>
val field = schema(ordinal)
val tCol = toTColumn(rows, ordinal, field.dataType)
(ordinal, tCol)
}.toList.sortBy(_._1).foreach { case (_, tCol) =>
tRowSet.addToColumns(tCol)
}
sw1.stop()
sw2.stop()
Expand Down

0 comments on commit e1f054e

Please sign in to comment.