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:ย 

[DELTA_CREATE_EXTERNAL_TABLE_WITHOUT_TXN_LOG]

Yannick_B
New Contributor

We are testing Delta writer in our environment  to create bronze tables and recently, I just needed to add one table to the notebook code and rerun the whole notebook that failed because of this error : [DELTA_CREATE_EXTERNAL_TABLE_WITHOUT_TXN_LOG] You are trying to create an external table `urochart-dev`.`qa_trunk`.`audittrail_2025_b` from `abfss://cdc-urochart@spsderlakeland01dev.dfs.core.windows.net/delta-tables-dev/audittrail_2025_b` using Delta, but there is no transaction log present at `abfss://cdc-urochart@spsderlakeland01dev.dfs.core.windows.net/delta-tables-dev/audittrail_2025_b/_delta_log`. Check the upstream job to make sure that it is writing using format("delta") and that the path is the root of the table. To learn more about Delta, see https://docs.microsoft.com/azure/databricks/delta/index SQLSTATE: 42K03

This how the notebook is structure, the first cell is a bunch DROP TABLE  table_b statements, then 

CREATE EXTERNAL TABLE qa_trunk.audittrail_2025_b using delta location 'abfss://cdc-urochart@spsderlakeland01dev.dfs.core.windows.net/delta-tables-dev/audittrail_2025_b';
I don't if someone here has faced this issue before so I can have some insight. I did a lot researches online but none of it help me fix that.
2 REPLIES 2

Sumit_7
Esteemed Contributor

@Yannick_B  The error tells us that the location is not a valid Delta table because _delta_log is missing. Check the path, folder and table.

balajij8
Contributor III

@Yannick_B You are trying to register an external table pointing to a directory that does not contain required Delta transaction logs (_delta_log folder) and hence you see the error.

When you run External Table Command, Databricks generally expects that data already exists at that ADLS Gen2 location and was written using the Delta format. However, since its empty & no data has been written to that path yet (_delta_log folder does not exist). Databricks refuses to create an external Delta table over an empty directory.

You can follow any of the below

  • Initialize the Table & Data
    Before you run the CREATE EXTERNAL TABLE statement, create a notebook that writes data to that path using DataFrame. This is suggested
df.write.format("delta").mode("append").save("abfss://cdc-urochart@spsderlakeland01dev.dfs.core.windows.net/delta-tables-dev/audittrail_2025_b")

The code creates the delta table & _delta_log. CREATE EXTERNAL TABLE statement will then work.

  • Provide a Schema
    You can explicitly define the column schema in the table statement. 
CREATE EXTERNAL TABLE qa_trunk.audittrail_2025_b (
id INT,
action STRING
-- Add bronze schema columns
)
USING delta
LOCATION 'abfss://cdc-urochart@spsderlakeland01dev.dfs.core.windows.net/delta-tables'