Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATTACH Duckdb not working #3360

Closed
semihsalihoglu-uw opened this issue Apr 23, 2024 · 1 comment · Fixed by #3364
Closed

ATTACH Duckdb not working #3360

semihsalihoglu-uw opened this issue Apr 23, 2024 · 1 comment · Fixed by #3364
Assignees
Labels
bug Something isn't working extensions high-priority

Comments

@semihsalihoglu-uw
Copy link
Contributor

I created a DuckDB file with the following python code after doing pip insteall duckdb:

import duckdb

conn = duckdb.connect('/duckdb-dbs/test/university.db')

# Insert data to person table
conn.execute("CREATE TABLE person (name VARCHAR, age INTEGER);")
conn.execute("INSERT INTO person values ('Alice', 30);")
conn.execute("INSERT INTO person values ('Bob', 27);")
conn.execute("INSERT INTO person values ('Carol', 19);")
conn.execute("INSERT INTO person values ('Dan', 25);")

The database actually exists. I can query it and get back those 4 tuples with the print(conn.execute("SELECT * FROM person").fetchdf()); line in Python. I also get the following when I do ls:

-rw-r--r--  1 xxxx  staff   524K Apr 23 16:19 /duckdb-dbs/test/university.db

Then I went through the instructions here to install and load duckdb_scanner extension. Then I attached the database:

---------------------------------
| result                        |
---------------------------------
| Attach database successfully. |
---------------------------------
Time: 0.01ms (compiling), 0.20ms (executing)

But it looks like the attaching is actually not successful. I can't run LOAD FROM or or Detach statements.

kuzu> LOAD FROM uw.person RETURN *;
Error: Binder exception: No database named uw has been attached.

kuzu> DETACH uw;
Error: Assertion failed in file "/Users/ssalihog/projects/vs-code-projects/kuzu/kuzu-master/src/main/database_manager.cpp" on line 44: KU_UNREACHABLE
@semihsalihoglu-uw
Copy link
Contributor Author

I think the problem is that I did not LOAD EXTENSION duckdb_scanner; in this session. I tried going through these steps again and I first ran LOAD EXTENSION duckdb_scanner; and this time I was able to run the LOAD FROM and DETACH statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working extensions high-priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants