diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TRowSetGenerator.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TRowSetGenerator.scala index 17b70db134b..5ac256ece6c 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TRowSetGenerator.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TRowSetGenerator.scala @@ -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 @@ -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)))