Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KYUUBI #6070] Improve perf on assembling row-based TRowSet #6077

Closed
wants to merge 4 commits into from
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 @@ -18,6 +18,8 @@
package org.apache.kyuubi.engine.result
import java.util.{ArrayList => JArrayList}

import scala.collection.JavaConverters._

import org.apache.kyuubi.shaded.hive.service.rpc.thrift._

trait TRowSetGenerator[SchemaT, RowT, ColumnT]
Expand All @@ -40,23 +42,17 @@ trait TRowSetGenerator[SchemaT, RowT, ColumnT]
}

def toRowBasedSet(rows: Seq[RowT], schema: SchemaT): TRowSet = {
val rowSize = rows.length
val tRows = new JArrayList[TRow](rowSize)
var i = 0
while (i < rowSize) {
val row = rows(i)
var j = 0
val tRows = rows.map { row =>
var i = 0
val columnSize = getColumnSizeFromSchemaType(schema)
val tColumnValues = new JArrayList[TColumnValue](columnSize)
while (j < columnSize) {
val columnValue = toTColumnValue(row, j, schema)
while (i < columnSize) {
val columnValue = toTColumnValue(row, i, schema)
tColumnValues.add(columnValue)
j += 1
i += 1
}
i += 1
val tRow = new TRow(tColumnValues)
tRows.add(tRow)
}
new TRow(tColumnValues)
}.asJava
new TRowSet(0, tRows)
}

Expand Down
Loading