Github user marmbrus commented on the pull request:
https://github.com/apache/spark/pull/10149#issuecomment-164874665
This seems reasonable, but if we are going to do work on `sqlContext.range`
it would be nice if we could take care of a bigger issue. Right now this code
is much slower than it needs to be.

I think that is is because we are boxing and creating a new Row for each
element. Instead, we should consider creating an actual logical/physical
operator for range. the implementation of doExecute() can mirror the code in
`sparkContext.range`, but would allocate one `UnsafeRow` per partition and just
call `setLong` for each element (reusing the same buffer).
Does that make sense?
Benchmark code here:
https://github.com/databricks/spark-sql-perf/blob/master/src/main/scala/com/databricks/spark/sql/perf/DatasetPerformance.scala
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]