Skip to content

Commit 8d42d03

Browse files
committed
Implement trigger() as limit() followed by collect()
Implement trigger() as limit() followed by collect()gdfg
1 parent 0402bd7 commit 8d42d03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sql/core/src/main/scala/org/apache/spark/sql/SchemaRDD.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@ class SchemaRDD(
374374

375375
override def collect(): Array[Row] = queryExecution.executedPlan.executeCollect()
376376

377+
override def take(num: Int): Array[Row] =
378+
new SchemaRDD(sqlContext, Limit(Literal(num), logicalPlan)).collect()
379+
377380
// =======================================================================
378381
// Base RDD functions that do NOT change schema
379382
// =======================================================================

0 commit comments

Comments
 (0)