spark-instrumented-optimizer/python/pyspark/sql
Davies Liu cc70f17416 [SPARK-14334] [SQL] add toLocalIterator for Dataset/DataFrame
## What changes were proposed in this pull request?

RDD.toLocalIterator() could be used to fetch one partition at a time to reduce the memory usage. Right now, for Dataset/Dataframe we have to use df.rdd.toLocalIterator, which is super slow also requires lots of memory (because of the Java serializer or even Kyro serializer).

This PR introduce an optimized toLocalIterator for Dataset/DataFrame, which is much faster and requires much less memory. For a partition with 5 millions rows, `df.rdd.toIterator` took about 100 seconds, but df.toIterator took less than 7 seconds. For 10 millions row, rdd.toIterator will crash (not enough memory) with 4G heap, but df.toLocalIterator could finished in 12 seconds.

The JDBC server has been updated to use DataFrame.toIterator.

## How was this patch tested?

Existing tests.

Author: Davies Liu <davies@databricks.com>

Closes #12114 from davies/local_iterator.
2016-04-04 13:31:44 -07:00
..
__init__.py [SPARK-12600][SQL] Remove deprecated methods in Spark SQL 2016-01-04 18:02:38 -08:00
column.py [SPARK-14088][SQL] Some Dataset API touch-up 2016-03-22 23:43:09 -07:00
context.py [SPARK-14014][SQL] Integrate session catalog (attempt #2) 2016-03-24 22:59:35 -07:00
dataframe.py [SPARK-14334] [SQL] add toLocalIterator for Dataset/DataFrame 2016-04-04 13:31:44 -07:00
functions.py [SPARK-14267] [SQL] [PYSPARK] execute multiple Python UDFs within single batch 2016-03-31 16:40:20 -07:00
group.py [SPARK-12756][SQL] use hash expression in Exchange 2016-01-13 22:43:28 -08:00
readwriter.py [SPARK-14231] [SQL] JSON data source infers floating-point values as a double when they do not fit in a decimal 2016-04-02 23:12:04 -07:00
tests.py [SPARK-12981] [SQL] extract Pyhton UDF in physical plan 2016-04-04 10:56:26 -07:00
types.py [SPARK-13593] [SQL] improve the createDataFrame to accept data type string and verify the data 2016-03-08 14:00:03 -08:00
utils.py [SPARK-14211][SQL] Remove ANTLR3 based parser 2016-03-31 09:25:09 -07:00
window.py [SPARK-14058][PYTHON] Incorrect docstring in Window.order 2016-03-21 23:52:33 -07:00