-DATASET CSV empty
-BUFFER_POOL_SIZE 268435456

--

-CASE DidNotLoadExtension
-SKIP_STATIC_LINK
-STATEMENT create node table person (id INT64, description json, primary key(id));
---- error
Catalog exception: JSON is neither an internal type nor a user defined type. This type exists in the JSON extension. You can install and load the extension by running 'INSTALL JSON; LOAD EXTENSION JSON;'.
-STATEMENT create node table person (id INT64, description STRING, primary key(id))
---- ok
-STATEMENT CREATE (p:person {id: 8, description: to_json({"family": "anatidae", "species": [ "duck", "goose", "swan", null]})})
---- error
Catalog exception: function TO_JSON is not defined. This function exists in the JSON extension. You can install and load the extension by running 'INSTALL JSON; LOAD EXTENSION JSON;'.

-CASE LoadFromError
-LOAD_DYNAMIC_EXTENSION json
-STATEMENT LOAD FROM '${KUZU_ROOT_DIRECTORY}/dataset/json-error/structured.json' RETURN *;
---- error
Copy exception: Error in file ${KUZU_ROOT_DIRECTORY}/dataset/json-error/structured.json on line 3: Malformed JSON: unexpected character, expected a valid JSON value. Line/record containing the error: '{"c":}...'

-STATEMENT LOAD FROM '${KUZU_ROOT_DIRECTORY}/dataset/json-error/structured_trailing_comma.json' RETURN *;
---- error
Copy exception: Error in file ${KUZU_ROOT_DIRECTORY}/dataset/json-error/structured_trailing_comma.json on line 11: Malformed JSON: unexpected character, expected a valid root value. Line/record containing the error: ']...'
-STATEMENT LOAD FROM '${KUZU_ROOT_DIRECTORY}/dataset/json-error/newline_delimited_invalid_value.json' RETURN *;
---- error
Copy exception: Error in file ${KUZU_ROOT_DIRECTORY}/dataset/json-error/newline_delimited_invalid_value.json on line 2: Malformed JSON: unexpected character, expected a comma or a closing brace. Line/record containing the error: '{"b": 2a...'
-STATEMENT LOAD FROM '${KUZU_ROOT_DIRECTORY}/dataset/json-error/newline_delimited_invalid_format.json' RETURN *;
---- error
Copy exception: Error in file ${KUZU_ROOT_DIRECTORY}/dataset/json-error/newline_delimited_invalid_format.json on line 1: Malformed JSON: unexpected character, expected a valid root value. Line/record containing the error: ',...'
-STATEMENT LOAD FROM '${KUZU_ROOT_DIRECTORY}/dataset/json-error/unstructured.json'(format='unstructured') RETURN *;
---- error(regex)
Copy exception: Error in file ${KUZU_ROOT_DIRECTORY}/dataset/json-error/unstructured.json on line 5: Malformed JSON: unexpected character, expected a valid JSON value. Line/record containing the error: '\{\s*"c":3,\s*"d":,...'
-STATEMENT LOAD FROM "${KUZU_ROOT_DIRECTORY}/dataset/tinysnb_json/vMovies.json"(IGNORE_ERRORS="abc") RETURN *;
---- error
Binder exception: IGNORE_ERRORS parameter must be a bool.
-STATEMENT LOAD FROM "${KUZU_ROOT_DIRECTORY}/dataset/tinysnb_json/vMovies.json"(AUTO_DETECT=false) RETURN *;
---- error
Binder exception: When auto-detect is set to false, Kuzu requires the user to provide column names and types in the LOAD FROM clause.
-STATEMENT LOAD FROM "${KUZU_ROOT_DIRECTORY}/dataset/tinysnb_json/vMovies.json"(AUTO_DETECT=false) RETURN *;
---- error
Binder exception: When auto-detect is set to false, Kuzu requires the user to provide column names and types in the LOAD FROM clause.
-STATEMENT LOAD FROM "${KUZU_ROOT_DIRECTORY}/dataset/tinysnb_json/vMovies_unstructured.json"(FORMAT='ARRAY') RETURN *;
---- error
Expected top-level JSON array with format='array', but first character is '{' in file "${KUZU_ROOT_DIRECTORY}/dataset/tinysnb_json/vMovies_unstructured.json".
Try setting format='auto' or format='newline_delimited'.

-CASE JsonTypeInvalidUsage
-LOAD_DYNAMIC_EXTENSION json
-STATEMENT CREATE NODE TABLE PERSON (ID INT64, NAME JSON, PRIMARY KEY(NAME));
---- error
Binder exception: Invalid primary key column type json. Primary keys must be either STRING or a numeric type.
-STATEMENT CREATE NODE TABLE PERSON (ID INT64, NAME JSON, description STRING, PRIMARY KEY(ID));
---- ok
-STATEMENT CREATE (p:PERSON {ID: 52, NAME: 'KUZU', DESCRIPTION: 'good'});
---- ok
-STATEMENT CREATE (p:PERSON {ID: 22, NAME: 'neo', DESCRIPTION: 'ok'});
---- ok
-STATEMENT CALL TABLE_INFO('person') RETURN *;
---- 3
0|ID|INT64|NULL|True
1|NAME|json|NULL|False
2|description|STRING|NULL|False
-STATEMENT MATCH (p:person) RETURN p.*;
---- 2
22|neo|ok
52|KUZU|good
-RELOADDB
-STATEMENT CALL TABLE_INFO('person') RETURN *;
---- 3
0|ID|INT64|NULL|True
1|NAME|json|NULL|False
2|description|STRING|NULL|False
-STATEMENT MATCH (p:person) RETURN p.*;
---- 2
22|neo|ok
52|KUZU|good
