GitHub user vanzin opened a pull request:
https://github.com/apache/spark/pull/15112
[RFC][SPARK-17549][sql] Only collect table size stat in driver for cached
relation.
The existing code caches all stats for all columns for each partition
in the driver; for a large relation, this causes extreme memory usage,
which leads to gc hell and application failures.
It seems that only the size in bytes of the data is actually used in the
driver, so instead just colllect that. In executors, the full stats are
still kept, but that's not a big problem; we expect the data to be
distributed
and thus not really incur in too much memory pressure in each individual
executor.
There are also potential improvements on the executor side, since the data
being stored currently is very wasteful (e.g. storing boxed types vs.
primitive types for stats). But that's a separate issue.
On a mildly related change, I'm also adding code to catch exceptions in the
code generator since Janino was breaking with the test data I tried this
patch on.
Tested with unit tests and by doing a count a very wide table (20k columns)
with many partitions.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/vanzin/spark SPARK-17549
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15112.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #15112
----
----
---
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]