kuzudb / kuzu

Embeddable property graph database management system built for query speed and scalability. Implements Cypher.
https://kuzudb.com/
MIT License
1.07k stars 77 forks source link

ATTACH Duckdb not working #3360

Closed semihsalihoglu-uw closed 3 weeks ago

semihsalihoglu-uw commented 3 weeks ago

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 commented 3 weeks ago

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.