Skip to content

[Question] Best practice to avoid "DATABASE_ALREADY_EXISTS" with session mode in chdb-go #357

@yidigo

Description

@yidigo

I'm using chdb-go (v3.4.1 of the underlying chdb library) in session mode to perform a task that involves reading data from a Parquet file and inserting it into another table using SQL, like Execute an INSERT INTO ... SELECT ... FROM file('...', 'Parquet') query.

Using the project https://github.com/chdb-io/chdb-go to do some sql.

I've noticed that after running this process for a while, I consistently encounter the following error:

clickhouse error (status 500): Code: 82. DB::Exception: Database _temporary_and_external_tables already exists. (DATABASE_ALREADY_EXISTS)

I believe this is because the temporary database created by the session is not being properly cleaned up between invocations of my processing logic. I found a somewhat related issue (chdb/issues/267), but it doesn't offer a direct solution to this specific problem.

How to delete _temporary_and_external_tables database to avoid the error? Or recommend best practice for managing session resources and avoiding this kind of stateful conflict? Are there any other scenarios or configurations I should be aware of to prevent this issue, especially in long-running applications or concurrent environments?

Thank you for your great work on chdb.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions