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: 

Where are default temporary checkpoint locations created for streaming queries with display command?

shavya
New Contributor

Hello!

I created a streaming query using Auto Loader to read data from S3 and used display command to see if the query was working. Initially, cloudFiles.includeExistingFiles was set to True, but since we have data in Glacier that needs to be retrieved before it can be read, the command failed. We did not provide a custom checkpoint location with the display command and spark.sql.streaming.checkpointLocation was set to None. Below is the code snippet -

source_s3_path = spark.conf.get("pipeline_dlt.source_s3_path")
checkpoint_location = spark.conf.get("pipeline_dlt.schema_checkpoint_location")

reader_options = {
    'cloudFiles.format': 'parquet',
    'cloudFiles.backfillInterval': '1 day',
    'cloudFiles.schemaLocation': schema_checkpoint_location,
    'mergeSchema': True,
    'maxFilesPerTrigger': 1,
}

df = spark.readStream.format(
    'cloudFiles'
).options(
    **reader_options
).load(
    source_s3_path
)

display(df)

We then set cloudFiles.includeExistingFiles to False and re-ran the query. Below is the updated code -

source_s3_path = spark.conf.get("pipeline_dlt.source_s3_path")
checkpoint_location = spark.conf.get("pipeline_dlt.schema_checkpoint_location")

reader_options = {
    'cloudFiles.format': 'parquet',
    'cloudFiles.includeExistingFiles': False,
    'cloudFiles.backfillInterval': '1 day',
    'cloudFiles.schemaLocation': schema_checkpoint_location,
    'mergeSchema': True,
    'maxFilesPerTrigger': 1,
}

df = spark.readStream.format(
    'cloudFiles'
).options(
    **reader_options
).load(
    source_s3_path
)

display(df)

Even then, the command failed. It keeps looking for older files that cannot be downloaded and fails. So we surmised that the new code snippet is picking up the temporary checkpoint that Databricks creates by default.

So my question is, where does Databricks create the temporary checkpoint location by default, when none is provided? I would like to find this location and clean it up so I can run my code.

Thanks!

0 REPLIES 0

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