cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to do bucketing in Databricks?

Arun_tsr
New Contributor III

We are migrating a job from onprem to databricks. We are trying to optimize the jobs but couldn't use bucketing because by default databricks stores all tables as delta table and it shows error that bucketing is not supported for delta. Is there anyway to do this?

6 REPLIES 6

Debayan
Databricks Employee
Databricks Employee

Arun_tsr
New Contributor III

Hi @Debayan Mukherjeeโ€‹ We are following similar syntax for creating the bucketed table. But we are getting the following error,

Operation not allowed: `Bucketing` is not supported for Delta tables

Databricks by default considering the created tables as delta

Pat
Honored Contributor III

Hi @Arun Balajiโ€‹ ,

bucketing is not supported for the delta tables as you have noticed.

For the optimization and best practices with delta tables check this:

https://docs.databricks.com/optimizations/index.html

https://docs.databricks.com/delta/best-practices.html

Arun_tsr
New Contributor III

Is it possible to create a table without making it a delta tableโ€‹?

Pat
Honored Contributor III

good question ๐Ÿ˜‰ I was going to mention this.

You can still use external tables. Those tables will be stored outside the main (root) metastore bucket/container.

https://docs.databricks.com/data-governance/unity-catalog/create-tables.html

https://docs.databricks.com/data-governance/unity-catalog/manage-external-locations-and-credentials....

then you can use parquet tables.

It seems like the way forward is to use managed tables with Unity Catalog, they are gaining some performance improvements over time.

Pat
Honored Contributor III

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now