Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/1048#discussion_r13636504
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/SchemaRDD.scala ---
@@ -374,6 +374,9 @@ class SchemaRDD(
override def collect(): Array[Row] =
queryExecution.executedPlan.executeCollect()
+ override def take(num: Int): Array[Row] =
+ new SchemaRDD(sqlContext, Limit(Literal(num), logicalPlan)).collect()
--- End diff --
maybe you can delegate to limit?
btw it is strange to me that limit takes an Expression. I can understand
why, but I can't see why on earth somebody would want to build a spark sql
expression to give a limit, if he could just give it an integer (or some scala
expression).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---