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: 

dataframe checkpoint when checkpoint location on abfss

Leigh_Turner
New Contributor

 

I'm trying to switch checkpoint locations from dbfs to abfss and i have noticed the following behaviour.

The spark.sparkContext.setCheckpointDir will fail unless I call...

dbutils.fs.mkdirs(checkpoint_dir) in the same cell.

On top of this, the df = df.checkpoint(True) will fail, unless I run dbutils.fs.mkdirs(checkpoint_dir) in the same cell.
In both cases the error message is

Invalid configuration value detected for fs.azure.account.keyInvalid configuration value detected for fs.azure.account.key

if i include all three of the above in one cell and in the following order, it works

dbutils.fs.mkdirs(checkpoint_dir)
spark.sparkContext.setCheckpointDir(checkpoint_dir)
df = spark.table("cat.sch.tbl").checkpoint(True)

This is different behavior as compared to dbfs checkpoint locations

any one have any ideas?

1 REPLY 1

Mounika_Tarigop
Databricks Employee
Databricks Employee

In DBFS, the checkpoint directory is automatically created when you set it using spark.sparkContext.setCheckpointDir(checkpoint_dir). This means that you do not need to explicitly create the directory beforehand using dbutils.fs.mkdirs(checkpoint_dir).

However, when using ABFSS, the directory does not get created automatically. You need to explicitly create the checkpoint directory using dbutils.fs.mkdirs(checkpoint_dir) before setting it with spark.sparkContext.setCheckpointDir(checkpoint_dir). This ensures that the directory exists and is accessible, which is why including dbutils.fs.mkdirs(checkpoint_dir) in the same cell is necessary for ABFSS but not for DBFS.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group