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 @@ -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