diff options
author | Shixiong Zhu <shixiong@databricks.com> | 2016-04-20 13:33:04 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2016-04-20 13:33:04 -0700 |
commit | 7bc948557bb6169cbeec335f8400af09375a62d3 (patch) | |
tree | ade7e22ce2b7794509a91339dbc0208ee0daca66 /python/pyspark/sql | |
parent | 296c384aff5bc1c0e8d411669f8f3e082cdf8f55 (diff) | |
download | spark-7bc948557bb6169cbeec335f8400af09375a62d3.tar.gz spark-7bc948557bb6169cbeec335f8400af09375a62d3.tar.bz2 spark-7bc948557bb6169cbeec335f8400af09375a62d3.zip |
[SPARK-14678][SQL] Add a file sink log to support versioning and compaction
## What changes were proposed in this pull request?
This PR adds a special log for FileStreamSink for two purposes:
- Versioning. A future Spark version should be able to read the metadata of an old FileStreamSink.
- Compaction. As reading from many small files is usually pretty slow, we should compact small metadata files into big files.
FileStreamSinkLog has a new log format instead of Java serialization format. It will write one log file for each batch. The first line of the log file is the version number, and there are multiple JSON lines following. Each JSON line is a JSON format of FileLog.
FileStreamSinkLog will compact log files every "spark.sql.sink.file.log.compactLen" batches into a big file. When doing a compact, it will read all history logs and merge them with the new batch. During the compaction, it will also delete the files that are deleted (marked by FileLog.action). When the reader uses allLogs to list all files, this method only returns the visible files (drops the deleted files).
## How was this patch tested?
FileStreamSinkLogSuite
Author: Shixiong Zhu <shixiong@databricks.com>
Closes #12435 from zsxwing/sink-log.
Diffstat (limited to 'python/pyspark/sql')
0 files changed, 0 insertions, 0 deletions