forked from delta-io/delta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for optimize (file compaction) on Delta tables
This PR adds the functionality to compact small files in a Delta table into large files through OPTIMIZE SQL command. The file compaction process potentially improves the performance of read queries on Delta tables. This processing (removing small files and adding large files) doesn't change the data in the table and the changes are committed transactionally to the Delta log. **Syntax of the SQL command** ``` OPTIMIZE ('/path/to/dir' | delta.table) [WHERE part = 25]; ``` * The SQL command allows selecting subset of partitions to operate file compaction on. **Configuration options** - `optimize.minFileSize` - Files which are smaller than this threshold (in bytes) will be grouped together and rewritten as larger files. - `optimize.maxFileSize` - Target file size produced by the OPTIMIZE command. - `optimize.maxThreads` - Maximum number of parallel jobs allowed in OPTIMIZE command New test suite `OptimizeCompactionSuite.scala` Closes delta-io#934 GitOrigin-RevId: f818d49b0f13296768e61f9f06fadf33a7831056
- Loading branch information
1 parent
f74ca6b
commit ddee78c
Showing
12 changed files
with
1,193 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.