What is the best way to convert a very large parquet table to delta ? possibly without downtime!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2021 02:44 PM
What is the best way to convert a very large parquet table to delta ? possibly without downtime!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2021 07:42 PM
You could run in-place convert with
CONVERT TO DELTA parquet.`/data-pipeline/`
CREATE TABLE events USING DELTA LOCATION '/data-pipeline/'This command lists all objects in the path, infers the data schema by reading the footers of all parquet files and creates the necessary metadata / statistics. This would be the least disruptive approach as you are not copying data over.
If you have multiple external tables share the same underlying parquet directory, you'd need to run convert for all of them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2021 10:29 PM
I vouch for Sajith's answer. The main advantage with "CONVERT TO DELTA" is that operations are metadata centric which means we are not reading the full data for the conversion. For any other file format conversion, it's necessary to read the data completely and write it to the target format.