Skip to content

Commit

Permalink
import CollectionConverters for 2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Dec 29, 2023
1 parent 693002b commit af5a01f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import java.util.{ArrayList => JArrayList}
import scala.collection.JavaConverters._
import scala.collection.parallel

import org.apache.kyuubi.SCALA_COMPILE_VERSION
import org.apache.kyuubi.engine.result.TRowSetGenerator._
import org.apache.kyuubi.shaded.hive.service.rpc.thrift._
import org.apache.kyuubi.util.ThreadUtils
Expand Down Expand Up @@ -89,7 +90,12 @@ trait TRowSetGenerator[SchemaT, RowT, ColumnT]
}

def toColumnBasedSetInParallel(rows: Seq[RowT], schema: SchemaT): TRowSet = {
val columnIndexPar = (0 until getColumnSizeFromSchemaType(schema)).par
SCALA_COMPILE_VERSION match {
case "2.13" =>
import scala.collection.parallel.CollectionConverters._
case _ =>
}
val columnIndexPar = (0 until getColumnSizeFromSchemaType(schema)).toIndexedSeq.par
columnIndexPar.tasksupport = tColumnParallelGenerator
val tColumns = columnIndexPar.map { colIdx =>
(colIdx, toTColumn(rows, colIdx, getColumnType(schema, colIdx)))
Expand Down

0 comments on commit af5a01f

Please sign in to comment.