-DATASET CSV empty
--

-CASE CreateHNSWAutoCommit
-SKIP_IN_MEM
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT CALL threads=1;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index',CAST([0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557],'FLOAT[8]'), 3) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
333
444
133
-RELOADDB
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index',CAST([0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557],'FLOAT[8]'), 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
333
444
133

-CASE CreateHNSWComit
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT BEGIN TRANSACTION;
---- ok
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- error
Binder exception: CREATE_VECTOR_INDEX is only supported in auto transaction mode.
# -STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index',CAST([0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557],'FLOAT[8]'), 3) RETURN node.id ORDER BY distance;
# -CHECK_ORDER
# ---- 3
# 333
# 444
# 133
# -STATEMENT COMMIT;
# ---- ok

-CASE DropHNSWComit
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-STATEMENT BEGIN TRANSACTION;
---- ok
-STATEMENT CALL DROP_VECTOR_INDEX('embeddings', 'e_hnsw_index');
---- ok
-STATEMENT COMMIT;
---- ok
-STATEMENT CALL show_indexes() RETURN *;
---- 0

-CASE CreateHNSWComitRecovery
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT BEGIN TRANSACTION;
---- ok
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- error
Binder exception: CREATE_VECTOR_INDEX is only supported in auto transaction mode.
# -STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index',CAST([0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557],'FLOAT[8]'), 3) RETURN node.id ORDER BY distance;
# -CHECK_ORDER
# ---- 3
# 333
# 444
# 133
# -STATEMENT COMMIT;
# ---- ok
# -RELOADDB
# -STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index',CAST([0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557],'FLOAT[8]'), 3, efs := 500) RETURN node.id ORDER BY distance;
# -CHECK_ORDER
# ---- 3
# 333
# 444
# 133

-CASE DropHNSWComitRecovery
-SKIP_IN_MEM
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-RELOADDB
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT BEGIN TRANSACTION;
---- ok
-STATEMENT CALL DROP_VECTOR_INDEX('embeddings', 'e_hnsw_index');
---- ok
-STATEMENT COMMIT;
---- ok
-STATEMENT CALL show_indexes() RETURN *;
---- 0
-RELOADDB
-STATEMENT CALL show_tables() RETURN *;
---- 1
0|embeddings|NODE|local(kuzu)|
-STATEMENT CALL show_indexes() RETURN *;
---- 0

-CASE CreateHNSWRollback
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT BEGIN TRANSACTION;
---- ok
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- error
Binder exception: CREATE_VECTOR_INDEX is only supported in auto transaction mode.
# -STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index',CAST([0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557],'FLOAT[8]'), 3, efs := 500) RETURN node.id ORDER BY distance;
# -CHECK_ORDER
# ---- 3
# 333
# 444
# 133
# -STATEMENT ROLLBACK;
# ---- ok
# -STATEMENT CALL SHOW_INDEXES() RETURN *;
# ---- 0

-CASE DropHNSWRollback
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-STATEMENT BEGIN TRANSACTION;
---- ok
-STATEMENT CALL DROP_VECTOR_INDEX('embeddings', 'e_hnsw_index');
---- ok
-STATEMENT ROLLBACK;
---- ok
-STATEMENT CALL show_indexes() RETURN *;
---- 1
embeddings|e_hnsw_index|HNSW|[vec]|True|CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index', 'vec', mu := 30, ml := 60, pu := 0.050000, metric := 'l2', alpha := 1.100000, efc := 200);

# TODO(Guodong): Uncomment this when we support CREATE_VECTOR_INDEX in the manual transaction mode.
# -CASE CreateHNSWRollbackRecovery
# -SKIP_IN_MEM
# -STATEMENT LOAD EXTENSION '${KUZU_ROOT_DIRECTORY}/extension/vector/build/libvector.kuzu_extension';
# ---- ok
# -STATEMENT BEGIN TRANSACTION;
# ---- ok
# -STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
# ---- ok
# -STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
# ---- ok
# -STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
# ---- error
# Binder exception: CREATE_VECTOR_INDEX is only supported in auto transaction mode.
# -STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index',CAST([0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557],'FLOAT[8]'), 3, efs := 500) RETURN node.id ORDER BY distance;
# -CHECK_ORDER
# ---- 3
# 333
# 444
# 133
# -STATEMENT ROLLBACK;
# ---- ok
# -STATEMENT CALL SHOW_INDEXES() RETURN *;
# ---- 0
# -RELOADDB
# -STATEMENT CALL SHOW_INDEXES() RETURN *;
# ---- 0

-CASE DropHNSWRollbackRecovery
-SKIP_IN_MEM
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-RELOADDB
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT BEGIN TRANSACTION;
---- ok
-STATEMENT CALL DROP_VECTOR_INDEX('embeddings', 'e_hnsw_index');
---- ok
-STATEMENT ROLLBACK;
---- ok
-STATEMENT CALL show_indexes() RETURN table_name, index_name, index_type, property_names;
---- 1
embeddings|e_hnsw_index|HNSW|[vec]
-RELOADDB
-STATEMENT CALL show_indexes() RETURN table_name, index_name, index_type, property_names;
---- 1
embeddings|e_hnsw_index|HNSW|[vec]

-CASE InsertRecovery
-SKIP_IN_MEM
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT CALL threads=1;
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
333
444
133
-RELOADDB
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE (t:embeddings {id: 1000, vec: [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557]});
---- ok
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
1000
333
444
-RELOADDB
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
1000
333
444

-CASE MultipleInsertionsRecovery
-SKIP_IN_MEM
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-RELOADDB
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CALL threads=1;
---- ok
-STATEMENT load from '${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv' with column0 as c0, column1 as c1 limit 500 CREATE (:embeddings {id: c0, vec: c1});
---- ok
-RELOADDB
-STATEMENT CALL threads=1;
---- ok
-STATEMENT load from '${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv' with column0 as c0, column1 as c1 skip 500 limit 500 CREATE (:embeddings {id: c0, vec: c1});
 ---- ok
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
333
444
133

-CASE DeleteRecovery
-SKIP_IN_MEM
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT CALL threads=1;
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-RELOADDB
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
333
444
133
-STATEMENT MATCH (e:embeddings) WHERE e.id = 333 DELETE e;
---- ok
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
444
133
598
-RELOADDB
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
444
133
598
-STATEMENT MATCH (e:embeddings) WHERE e.id = 444 DELETE e;
---- ok
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
133
598
225
-RELOADDB
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
133
598
225

-CASE DeleteBulkRecovery
-SKIP_IN_MEM
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CREATE NODE TABLE embeddings (id int64, vec FLOAT[8], PRIMARY KEY (id));
---- ok
-STATEMENT CALL threads=1;
---- ok
-STATEMENT COPY embeddings FROM "${KUZU_ROOT_DIRECTORY}/dataset/embeddings/embeddings-8-1k.csv" (deLim=',');
---- ok
-STATEMENT CALL CREATE_VECTOR_INDEX('embeddings', 'e_hnsw_index','vec', metric := 'l2');
---- ok
-RELOADDB
-STATEMENT CALL force_checkpoint_on_close=false;
---- ok
-STATEMENT CALL auto_checkpoint=false;
---- ok
-LOAD_DYNAMIC_EXTENSION vector
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
333
444
133
-STATEMENT MATCH (e:embeddings) WHERE e.id <=200 DELETE e;
---- ok
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
333
444
598
-RELOADDB
-STATEMENT CALL QUERY_VECTOR_INDEX('embeddings', 'e_hnsw_index', [0.1521,0.3021,0.5366,0.2774,0.5593,0.5589,0.1365,0.8557], 3, efs := 500) RETURN node.id ORDER BY distance;
-CHECK_ORDER
---- 3
333
444
598
