databricks-demos / dbdemos

Demos to implement your Databricks Lakehouse
Other
255 stars 80 forks source link

The associated location ('dbfs:/user/hive/warehouse/databricks_documentation') is not empty and also not a Delta table. #98

Closed rileynjohnson closed 5 months ago

rileynjohnson commented 5 months ago

Hoping for some help on this one, too!

%sql
DROP TABLE IF EXISTS databricks_documentation;
--Note that we need to enable Change Data Feed on the table to create the index
CREATE TABLE IF NOT EXISTS databricks_documentation (
  id BIGINT GENERATED BY DEFAULT AS IDENTITY,
  url STRING,
  content STRING,
  embedding ARRAY <FLOAT>
) TBLPROPERTIES (delta.enableChangeDataFeed = true); 

DeltaAnalysisException: [DELTA_CREATE_TABLE_WITH_NON_EMPTY_LOCATION] Cannot create table ('spark_catalog.default.databricks_documentation'). The associated location ('dbfs:/user/hive/warehouse/databricks_documentation') is not empty and also not a Delta table.

QuentinAmbard commented 5 months ago

hey, I think you just forgot to run the init cell. It should setup your catalog by default to use the main catalog. Just make sure you run the initial %run ../_resource/01-init cell and it'll fix the issue! feel free to re-open if it's not the case