I have an external delta table partitioned by year in my storage, so when I try to "mount" the delta in Databricks table using this code:
CREATE TABLE if not exists profitek.products
USING DELTA
LOCATION 'dbfs:/mnt/curated-l1/profitek/products'
I get this error:
You are trying to create an external table spark_catalog
.general
.products
from dbfs:/mnt/curated-l1/general/products
using Databricks Delta, but there is no transaction log present at
dbfs:/mnt/curated-l1/general/products/_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.
The _delta_log file is inside every partition
products
│
├── 2022-01-01
│ ├── _delta_log
│ ├── part_01.parquet
│ └── part_02.parquet
├── 2022-01-02
├── _delta_log
├── part_01.parquet
└── part_02.parquet
So I can mount a PART of the table using something like this
CREATE TABLE if not exists profitek.products
USING DELTA
LOCATION 'dbfs:/mnt/curated-l1/profitek/products/2022-01-01'
How can I "mount" the full table, with all his partitions??