-DATASET CSV tinysnb

--

-CASE ErrorCases
-LOAD_DYNAMIC_EXTENSION fts
-STATEMENT CALL CREATE_FTS_INDEX('person1', 'contentIdx', ['content'])
---- error
Binder exception: Table person1 does not exist.

-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx', ['fName'])
---- ok

-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx', ['fName'])
---- error
Binder exception: Index personIdx already exists in table person.

-STATEMENT CALL CREATE_FTS_INDEX('knows', 'personIdx', ['fName'])
---- error
Binder exception: knows is not of type NODE.

-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx1', ['fName1'])
---- error
Binder exception: Property: fName1 does not exist in table person.

-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx2', ['fName', 'fName1'])
---- error
Binder exception: Property: fName1 does not exist in table person.

-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx3', ['gender'])
---- error
Binder exception: Full text search index can only be built on string properties.

-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx4', ['fName', 'gender'])
---- error
Binder exception: Full text search index can only be built on string properties.

-STATEMENT CALL QUERY_FTS_INDEX('person', 'personIdx1', 'alice') RETURN *
---- error
Binder exception: Table person doesn't have an index with name personIdx1.

-STATEMENT CALL QUERY_FTS_INDEX('person1', 'personIdx', 'alice') RETURN *
---- error
Binder exception: Table person1 does not exist.

-STATEMENT CALL QUERY_FTS_INDEX('knows', 'personIdx', 'alice') RETURN *
---- error
Binder exception: knows is not of type NODE.

-STATEMENT CALL QUERY_FTS_INDEX('movies', 'personIdx', 'alice') RETURN *
---- error
Binder exception: Table movies doesn't have an index with name personIdx.

-STATEMENT CALL DROP_FTS_INDEX('person1', 'personIdx')
---- error
Binder exception: Table person1 does not exist.

-STATEMENT CALL DROP_FTS_INDEX('knows', 'personIdx')
---- error
Binder exception: knows is not of type NODE.

-STATEMENT CALL DROP_FTS_INDEX('person', 'personIdx1')
---- error
Binder exception: Table person doesn't have an index with name personIdx1.

-STATEMENT CALL DROP_FTS_INDEX('person', 'personIdx')
---- ok

-STATEMENT CALL QUERY_FTS_INDEX('person', 'personIdx', 'alice') RETURN *
---- error
Binder exception: Table person doesn't have an index with name personIdx.

-STATEMENT BEGIN TRANSACTION
---- ok
-STATEMENT CALL CREATE_FTS_INDEX('person', 'otherIdx', ['fName'])
---- error
Binder exception: CREATE_FTS_INDEX is only supported in auto transaction mode.

-STATEMENT BEGIN TRANSACTION
---- ok
-STATEMENT CALL DROP_FTS_INDEX('person1', 'contentIdx')
---- error
Binder exception: DROP_FTS_INDEX is only supported in auto transaction mode.


-CASE DuplicateIndexes
-LOAD_DYNAMIC_EXTENSION fts
-STATEMENT CALL CREATE_FTS_INDEX('movies', 'moviesIdx', ['name'])
---- ok
-STATEMENT CALL QUERY_FTS_INDEX('movies', 'moviesIdx', 'movie') RETURN node.name
---- 1
The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie

-STATEMENT CALL CREATE_FTS_INDEX('movies', 'moviesIdx2', ['name', 'note'])
---- ok
-STATEMENT CALL QUERY_FTS_INDEX('movies', 'moviesIdx2', 'movie') RETURN node.name
---- 3
The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie
Sóló cón tu párejâ
Roma



-CASE DropTableWithIndexes
-LOAD_DYNAMIC_EXTENSION fts
-STATEMENT CREATE NODE TABLE STUDENT (ID INT64, name string, age INT64, note string, PRIMARY KEY(ID))
---- ok
-STATEMENT CALL CREATE_FTS_INDEX('STUDENT', 'sIdx1', ['name'])
---- ok
-STATEMENT CALL CREATE_FTS_INDEX('STUDENT', 'sIdx2', ['name', 'note'])
---- ok
-STATEMENT CALL QUERY_FTS_INDEX('STUDENT', 'sIdx1', 'test') RETURN *
---- 0
-STATEMENT CALL QUERY_FTS_INDEX('STUDENT', 'sIdx2', 'test') RETURN *
---- 0
-STATEMENT ALTER TABLE STUDENT DROP name;
---- error
Binder exception: Cannot drop property name in table STUDENT because it is used in one or more indexes. Please remove the associated indexes before attempting to drop this property.
-STATEMENT CALL DROP_FTS_INDEX('STUDENT', 'sIdx1')
---- ok
-STATEMENT ALTER TABLE STUDENT DROP note;
---- error
Binder exception: Cannot drop property note in table STUDENT because it is used in one or more indexes. Please remove the associated indexes before attempting to drop this property.
-STATEMENT ALTER TABLE STUDENT ADD length int64;
---- ok
-STATEMENT ALTER TABLE STUDENT DROP age;
---- ok
-STATEMENT DROP TABLE STUDENT
---- error
Binder exception: Cannot delete node table STUDENT because it is referenced by index sIdx2.
-STATEMENT CALL QUERY_FTS_INDEX('STUDENT', 'sIdx1', 'test') RETURN *
---- error
Binder exception: Table STUDENT doesn't have an index with name sIdx1.
-STATEMENT CALL QUERY_FTS_INDEX('STUDENT', 'sIdx2', 'test') RETURN *
---- ok

-CASE ExtensionNotLoaded
-SKIP_IN_MEM
-SKIP_STATIC_LINK
-STATEMENT CREATE NODE TABLE STUDENT (ID INT64, name string, age INT64, note string, PRIMARY KEY(ID))
---- ok
-STATEMENT CREATE (:Student {id:1, name:'Bob'});
---- ok
-STATEMENT CALL CREATE_FTS_INDEX('STUDENT', 'sIdx', ['name'])
---- error
Catalog exception: function CREATE_FTS_INDEX is not defined. This function exists in the FTS extension. You can install and load the extension by running 'INSTALL FTS; LOAD EXTENSION FTS;'.
-STATEMENT CALL QUERY_FTS_INDEX('STUDENT', 'sIdx', 'test') RETURN *
---- error
Catalog exception: function QUERY_FTS_INDEX is not defined. This function exists in the FTS extension. You can install and load the extension by running 'INSTALL FTS; LOAD EXTENSION FTS;'.
-STATEMENT CALL DROP_FTS_INDEX('STUDENT', 'sIdx')
---- error
Catalog exception: function DROP_FTS_INDEX is not defined. This function exists in the FTS extension. You can install and load the extension by running 'INSTALL FTS; LOAD EXTENSION FTS;'.
-LOAD_DYNAMIC_EXTENSION fts
-STATEMENT CALL CREATE_FTS_INDEX('STUDENT', 'sIdx', ['name'])
---- ok
-RELOADDB
-STATEMENT CREATE (:Student {id:0, name:'Alice'});
---- error
Binder exception: Trying to insert into an index on table STUDENT but its extension is not loaded.
-STATEMENT MERGE (:Student {id:0, name:'Alice'});
---- error
Binder exception: Trying to insert into an index on table STUDENT but its extension is not loaded.
-STATEMENT COPY Student FROM (RETURN 100 AS id, 'Bob' AS name, 25 AS age, 'hhh' AS note)
---- error
Binder exception: Trying to insert into an index on table STUDENT but its extension is not loaded.
-STATEMENT MATCH (a:Student) DELETE a;
---- error
Binder exception: Trying to delete from an index on table STUDENT but its extension is not loaded.
-STATEMENT ALTER TABLE STUDENT DROP name;
---- error
Binder exception: Cannot drop property name in table STUDENT because it is used in one or more indexes. Please remove the associated indexes before attempting to drop this property.

-CASE CreateFTSSingleStatement
-SKIP_STATIC_LINK
-STATEMENT load extension "${KUZU_ROOT_DIRECTORY}/extension/fts/build/libfts.kuzu_extension";CALL CREATE_FTS_INDEX('person', 'personIdx', ['fName']);
---- error
Parser exception: CREATE_FTS_INDEX must be called in a query which doesn't have other statements.

-CASE DropFTSSingleStatement
-SKIP_STATIC_LINK
-STATEMENT load extension "${KUZU_ROOT_DIRECTORY}/extension/fts/build/libfts.kuzu_extension";CALL DROP_FTS_INDEX('STUDENT', 'sIdx');
---- error
Parser exception: DROP_FTS_INDEX must be called in a query which doesn't have other statements.

-CASE TopParamZero
-LOAD_DYNAMIC_EXTENSION fts
-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx', ['fName'])
---- ok
-STATEMENT CALL QUERY_FTS_INDEX('person', 'personIdx', 'Alice', top := 0) RETURN node.ID, score
---- error
Binder exception: QUERY_FTS_INDEX requires a positive non-zero value for the 'top' parameter.

-CASE NonStringIgnorePattern
-LOAD_DYNAMIC_EXTENSION fts
-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx', ['fName'], ignore_pattern := true)
---- error
Binder exception: True has data type BOOL but STRING was expected.
-STATEMENT CALL CREATE_FTS_INDEX('person', 'personIdx', ['fName'], ignore_pattern := '[a-z')
---- error
Binder exception: An error occurred while compiling the regex: "[a-z".
Error: "missing ]: [a-z".
