Skip to content

Commit 6320ebf

Browse files
committed
[SPARK-49408][SQL] Use IndexedSeq in ProjectingInternalRow
1 parent eb79fc4 commit 6320ebf

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ProjectingInternalRow.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import org.apache.spark.unsafe.types.{CalendarInterval, UTF8String, VariantVal}
2626
* An [[InternalRow]] that projects particular columns from another [[InternalRow]] without copying
2727
* the underlying data.
2828
*/
29-
case class ProjectingInternalRow(schema: StructType, colOrdinals: Seq[Int]) extends InternalRow {
29+
case class ProjectingInternalRow(schema: StructType,
30+
colOrdinals: IndexedSeq[Int]) extends InternalRow {
3031
assert(schema.size == colOrdinals.size)
3132

3233
private var row: InternalRow = _
@@ -116,3 +117,9 @@ case class ProjectingInternalRow(schema: StructType, colOrdinals: Seq[Int]) exte
116117
row.get(colOrdinals(ordinal), dataType)
117118
}
118119
}
120+
121+
object ProjectingInternalRow {
122+
def apply(schema: StructType, colOrdinals: Seq[Int]): ProjectingInternalRow = {
123+
new ProjectingInternalRow(schema, colOrdinals.toIndexedSeq)
124+
}
125+
}

0 commit comments

Comments
 (0)