Skip to content

MySQL needs METADATA_PATH but only after DuckLake is initialized #385

@guillesd

Description

@guillesd

What happens?

When initializing Ducklake for the first time (ATTACH command with a fresh catalog) there is no need to specify a METADATA_SCHEMA property. However, subsequent ATTACH statements will need this METADATA_SCHEMA or it will throw the following error:

IO Error:
Failed to initialize DuckLake:Failed to run query "CREATE TABLE `ducklake_metadata`.`ducklake_metadata`(`key` TEXT NOT NULL, `value` TEXT NOT NULL, `scope` TEXT, `scope_id` BIGINT);": Table 'ducklake_metadata' already exists

To Reproduce

-- First time, initialization --> Works
ATTACH 'ducklake:mysql:db=ducklake_metadata host=127.0.0.1 port=3306 user=root password=simple' AS ducklake_db (DATA_PATH '/Users/guillesd/Dev/reproducers/issue_288/ducklake_data')

-- subsequent attachment without METADATA_SCHEMA --> Doesn't work
ATTACH 'ducklake:mysql:db=ducklake_metadata host=127.0.0.1 port=3306 user=root password=simple' AS ducklake_db (DATA_PATH '/Users/guillesd/Dev/reproducers/issue_288/ducklake_data')

-- subsequent attachment with METADATA_SCHEMA
ATTACH 'ducklake:mysql:db=ducklake_metadata host=127.0.0.1 port=3306 user=root password=simple' AS ducklake_db (DATA_PATH '/Users/guillesd/Dev/reproducers/issue_288/ducklake_data', METADATA_SCHEMA 'ducklake_catalog')

OS:

arm64

DuckDB Version:

1.3.2

DuckLake Version:

0.2

DuckDB Client:

CLI

Hardware:

No response

Full Name:

Guillermo Sanchez

Affiliation:

DuckDB

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Not applicable - the reproduction does not require a data set

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions