Skip to content

Commit 6a519d8

Browse files
committed
Remove unnecessary copy() and test cases.
1 parent 04eb37e commit 6a519d8

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ case class TakeOrderedAndProject(
225225
private def collectData(): Array[InternalRow] = {
226226
val data = child.execute().map(_.copy()).takeOrdered(limit)(ord)
227227
if (projection.isDefined) {
228-
projection.map(p => data.map(p(_).copy().asInstanceOf[InternalRow])).get
228+
projection.map(p => data.map(p(_).asInstanceOf[InternalRow])).get
229229
} else {
230230
data
231231
}

sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,6 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
571571
mapData.collect().take(1).map(Row.fromTuple).toSeq)
572572
}
573573

574-
test("sort and limit") {
575-
checkAnswer(
576-
sql("SELECT * FROM arrayData ORDER BY data[0] ASC LIMIT 1"),
577-
arrayData.collect().sortBy(_.data(0)).map(Row.fromTuple).take(1).toSeq)
578-
}
579-
580574
test("CTE feature") {
581575
checkAnswer(
582576
sql("with q1 as (select * from testData limit 10) select * from q1"),

0 commit comments

Comments
 (0)