Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!
cancel
Showing results for 
Search instead for 
Did you mean: 
_riccardo
Partner - Contributor
Partner - Contributor

DELTA_CREATE_TABLE_WITH_NON_EMPTY_LOCATION Error with Databricks Target

Hi everyone,

I’m running a Qlik Replicate task with Databricks as the target endpoint, and I’m periodically encountering the following error:

DELTA_CREATE_TABLE_WITH_NON_EMPTY_LOCATION [...]: Cannot create table [...]. The associated location [...] is not empty and also not a Delta table.

This issue is causing significant latency increases and is becoming disruptive to our workflows.

Is there a reliable way to prevent this error from occurring?

Thank you in advance for any guidance!

 

Labels (4)
1 Solution

Accepted Solutions
john_wang
Support
Support

Hello @_riccardo ,

In addition to @OritA 's comment, one possible cause of the issue is the use of "DROP TABLE" followed by "CREATE TABLE" commands. This pattern can lead to problems, especially with Delta tables. Databricks recommends using "CREATE OR REPLACE" to overwrite a Delta table, instead of dropping and recreating it.

As a workaround, please try the following steps:

  1. Manually remove the target folder (if applicable).

  2. Add the internal parameter in target Endpoint:  $info.query_syntax.create_table

CREATE or REPLACE ${TABLE_TYPE} TABLE ${QO}${TABLE_OWNER}${QC}.${QO}${TABLE_NAME}${QC} ( ${COLUMN_LIST} ) USING DELTA TBLPROPERTIES (delta.autoOptimize.optimizeWrite = true)

Hope it helps.

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!

View solution in original post

2 Replies
OritA
Support
Support

Hi, 

I am not sure what is your exact setting. However, as indicated in the Replicate users guide under the following section :
"https://help.qlik.com/en-US/replicate/May2025/Content/Replicate/Main/DatabricksCloudStorage/databric...
'Replication to Delta tables is not supported'
If this is not the scenario in your case, please open a salesforce case and attach to it the task log and the task diagnostic package for further investigation. 

Regards,

Orit

john_wang
Support
Support

Hello @_riccardo ,

In addition to @OritA 's comment, one possible cause of the issue is the use of "DROP TABLE" followed by "CREATE TABLE" commands. This pattern can lead to problems, especially with Delta tables. Databricks recommends using "CREATE OR REPLACE" to overwrite a Delta table, instead of dropping and recreating it.

As a workaround, please try the following steps:

  1. Manually remove the target folder (if applicable).

  2. Add the internal parameter in target Endpoint:  $info.query_syntax.create_table

CREATE or REPLACE ${TABLE_TYPE} TABLE ${QO}${TABLE_OWNER}${QC}.${QO}${TABLE_NAME}${QC} ( ${COLUMN_LIST} ) USING DELTA TBLPROPERTIES (delta.autoOptimize.optimizeWrite = true)

Hope it helps.

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!