cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

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?

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @Manish Pโ€‹ , You have three options for converting a Parquet table to a Delta table.

  • Convert files to Delta Lake format and then create a Delta table:
CONVERT TO DELTA parquet.`/data-pipeline/`
CREATE TABLE events USING DELTA LOCATION '/data-pipeline/'
  • Create a Parquet table and then convert it to a Delta table:
CREATE TABLE events USING PARQUET OPTIONS (path '/data-pipeline/')
CONVERT TO DELTA events
  • Convert a Parquet table to a Delta table:
CONVERT TO DELTA events

This assumes that the table named events is a Parquet table.

For details, see Convert a Parquet table to a Delta table.

View solution in original post

4 REPLIES 4

Kaniz
Community Manager
Community Manager

Hi @ mp! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers on the community have an answer to your question first. Or else I will follow up with my team and get back to you soon.Thanks.

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

Kaniz
Community Manager
Community Manager

Hi @Manish Pโ€‹ , You have three options for converting a Parquet table to a Delta table.

  • Convert files to Delta Lake format and then create a Delta table:
CONVERT TO DELTA parquet.`/data-pipeline/`
CREATE TABLE events USING DELTA LOCATION '/data-pipeline/'
  • Create a Parquet table and then convert it to a Delta table:
CREATE TABLE events USING PARQUET OPTIONS (path '/data-pipeline/')
CONVERT TO DELTA events
  • Convert a Parquet table to a Delta table:
CONVERT TO DELTA events

This assumes that the table named events is a Parquet table.

For details, see Convert a Parquet table to a Delta table.

saipardhu
New Contributor II

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

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.