How can I convert a parquet into delta table?

mp
New Contributor II

I am looking to migrate my legacy warehouse data. How can I convert a parquet into delta table?

spark-user
Contributor

Hi mp,

You have two options to convert a parquet into a delta table through SQL

CONVERT TO DELTA parquet.`/data-pipeline/`
CREATE TABLE events USING DELTA LOCATION '/data-pipeline/'

or

CREATE TABLE events USING PARQUET OPTIONS (path '/data-pipeline/')
CONVERT TO DELTA events

If you want to learn about the differences between the two, there is actually a document on Databricks that explains it in detail

https://docs.databricks.com/delta/porting.html

Thank you

how about the scenario where your table is external and partitioned with files in s3?