diff --git a/src/binder/bind/bind_ddl.cpp b/src/binder/bind/bind_ddl.cpp index 48c4762feb..fc7f3d7310 100644 --- a/src/binder/bind/bind_ddl.cpp +++ b/src/binder/bind/bind_ddl.cpp @@ -151,7 +151,6 @@ std::vector Binder::bindProperties( StringUtils::string_format("PropertyName: {} is an internal reserved propertyName.", propertyNameDataType.first)); } - StringUtils::toUpper(propertyNameDataType.second); auto dataType = bindDataType(propertyNameDataType.second); boundPropertyNameDataTypes.emplace_back(propertyNameDataType.first, dataType); boundPropertyNames.emplace(propertyNameDataType.first); diff --git a/src/binder/bound_statement_result.cpp b/src/binder/bound_statement_result.cpp index a6fcaed20d..46a5ec6d11 100644 --- a/src/binder/bound_statement_result.cpp +++ b/src/binder/bound_statement_result.cpp @@ -5,9 +5,9 @@ namespace kuzu { namespace binder { -std::unique_ptr BoundStatementResult::createSingleStringColumnResult() { +std::unique_ptr BoundStatementResult::createSingleStringColumnResult( + std::string columnName) { auto result = std::make_unique(); - auto columnName = std::string("result"); auto value = std::make_unique( common::LogicalType{common::LogicalTypeID::STRING}, columnName); auto stringColumn = std::make_shared(std::move(value), columnName); diff --git a/src/common/types/types.cpp b/src/common/types/types.cpp index f039f82075..63dadf8c8c 100644 --- a/src/common/types/types.cpp +++ b/src/common/types/types.cpp @@ -81,12 +81,6 @@ std::unique_ptr FixedListTypeInfo::copy() const { return std::make_unique(childType->copy(), fixedNumElementsInList); } -StructField::StructField(std::string name, std::unique_ptr type) - : name{std::move(name)}, type{std::move(type)} { - // Note: struct field name is case-insensitive. - StringUtils::toUpper(this->name); -} - bool StructField::operator==(const kuzu::common::StructField& other) const { return *type == *other.type; } @@ -98,7 +92,9 @@ std::unique_ptr StructField::copy() const { StructTypeInfo::StructTypeInfo(std::vector> fields) : fields{std::move(fields)} { for (auto i = 0u; i < this->fields.size(); i++) { - fieldNameToIdxMap.emplace(this->fields[i]->getName(), i); + auto fieldName = this->fields[i]->getName(); + StringUtils::toUpper(fieldName); + fieldNameToIdxMap.emplace(std::move(fieldName), i); } } @@ -281,11 +277,12 @@ void LogicalType::setPhysicalType() { LogicalType LogicalTypeUtils::dataTypeFromString(const std::string& dataTypeString) { LogicalType dataType; - if (dataTypeString.ends_with("[]")) { + auto upperDataTypeString = StringUtils::toUpperCase(dataTypeString); + if (upperDataTypeString.ends_with("[]")) { dataType.typeID = LogicalTypeID::VAR_LIST; dataType.extraTypeInfo = std::make_unique(std::make_unique( dataTypeFromString(dataTypeString.substr(0, dataTypeString.size() - 2)))); - } else if (dataTypeString.ends_with("]")) { + } else if (upperDataTypeString.ends_with("]")) { dataType.typeID = LogicalTypeID::FIXED_LIST; auto leftBracketPos = dataTypeString.find('['); auto rightBracketPos = dataTypeString.find(']'); @@ -296,7 +293,7 @@ LogicalType LogicalTypeUtils::dataTypeFromString(const std::string& dataTypeStri nullptr, 0 /* base */); dataType.extraTypeInfo = std::make_unique(std::move(childType), fixedNumElementsInList); - } else if (dataTypeString.starts_with("STRUCT")) { + } else if (upperDataTypeString.starts_with("STRUCT")) { dataType.typeID = LogicalTypeID::STRUCT; auto leftBracketPos = dataTypeString.find('('); auto rightBracketPos = dataTypeString.find_last_of(')'); @@ -324,33 +321,34 @@ LogicalType LogicalTypeUtils::dataTypeFromString(const std::string& dataTypeStri } LogicalTypeID LogicalTypeUtils::dataTypeIDFromString(const std::string& dataTypeIDString) { - if ("INTERNAL_ID" == dataTypeIDString) { + auto upperDataTypeIDString = StringUtils::toUpperCase(dataTypeIDString); + if ("INTERNAL_ID" == upperDataTypeIDString) { return LogicalTypeID::INTERNAL_ID; - } else if ("INT64" == dataTypeIDString) { + } else if ("INT64" == upperDataTypeIDString) { return LogicalTypeID::INT64; - } else if ("INT32" == dataTypeIDString) { + } else if ("INT32" == upperDataTypeIDString) { return LogicalTypeID::INT32; - } else if ("INT16" == dataTypeIDString) { + } else if ("INT16" == upperDataTypeIDString) { return LogicalTypeID::INT16; - } else if ("INT" == dataTypeIDString) { + } else if ("INT" == upperDataTypeIDString) { return LogicalTypeID::INT32; - } else if ("DOUBLE" == dataTypeIDString) { + } else if ("DOUBLE" == upperDataTypeIDString) { return LogicalTypeID::DOUBLE; - } else if ("FLOAT" == dataTypeIDString) { + } else if ("FLOAT" == upperDataTypeIDString) { return LogicalTypeID::FLOAT; - } else if ("BOOLEAN" == dataTypeIDString) { + } else if ("BOOLEAN" == upperDataTypeIDString) { return LogicalTypeID::BOOL; - } else if ("BYTEA" == dataTypeIDString || "BLOB" == dataTypeIDString) { + } else if ("BYTEA" == upperDataTypeIDString || "BLOB" == upperDataTypeIDString) { return LogicalTypeID::BLOB; - } else if ("STRING" == dataTypeIDString) { + } else if ("STRING" == upperDataTypeIDString) { return LogicalTypeID::STRING; - } else if ("DATE" == dataTypeIDString) { + } else if ("DATE" == upperDataTypeIDString) { return LogicalTypeID::DATE; - } else if ("TIMESTAMP" == dataTypeIDString) { + } else if ("TIMESTAMP" == upperDataTypeIDString) { return LogicalTypeID::TIMESTAMP; - } else if ("INTERVAL" == dataTypeIDString) { + } else if ("INTERVAL" == upperDataTypeIDString) { return LogicalTypeID::INTERVAL; - } else if ("SERIAL" == dataTypeIDString) { + } else if ("SERIAL" == upperDataTypeIDString) { return LogicalTypeID::SERIAL; } else { throw NotImplementedException("Cannot parse dataTypeID: " + dataTypeIDString); diff --git a/src/include/binder/bound_explain.h b/src/include/binder/bound_explain.h index 66671e1c24..81fe53dfc3 100644 --- a/src/include/binder/bound_explain.h +++ b/src/include/binder/bound_explain.h @@ -11,7 +11,8 @@ class BoundExplain : public BoundStatement { explicit BoundExplain( std::unique_ptr statementToExplain, common::ExplainType explainType) : BoundStatement{common::StatementType::EXPLAIN, - BoundStatementResult::createSingleStringColumnResult()}, + BoundStatementResult::createSingleStringColumnResult( + "explain result" /* columnName */)}, statementToExplain{std::move(statementToExplain)}, explainType{explainType} {} inline BoundStatement* getStatementToExplain() const { return statementToExplain.get(); } diff --git a/src/include/binder/bound_statement_result.h b/src/include/binder/bound_statement_result.h index 700dd037e2..986e0f4f0b 100644 --- a/src/include/binder/bound_statement_result.h +++ b/src/include/binder/bound_statement_result.h @@ -17,7 +17,8 @@ class BoundStatementResult { return std::make_unique(); } - static std::unique_ptr createSingleStringColumnResult(); + static std::unique_ptr createSingleStringColumnResult( + std::string columnName = "result"); inline void addColumn( std::shared_ptr column, expression_vector expressionToCollect) { diff --git a/src/include/common/string_utils.h b/src/include/common/string_utils.h index 6b1ef45b86..accf8c5f8c 100644 --- a/src/include/common/string_utils.h +++ b/src/include/common/string_utils.h @@ -29,6 +29,12 @@ class StringUtils { std::transform(input.begin(), input.end(), input.begin(), ::toupper); } + static std::string toUpperCase(const std::string& input) { + auto result = input; + toUpper(result); + return result; + } + static void toLower(std::string& input) { std::transform(input.begin(), input.end(), input.begin(), ::tolower); } diff --git a/src/include/common/types/types.h b/src/include/common/types/types.h index 37c3b34bd4..6c6b3c3687 100644 --- a/src/include/common/types/types.h +++ b/src/include/common/types/types.h @@ -157,7 +157,8 @@ class StructField { public: StructField() : type{std::make_unique()} {} - StructField(std::string name, std::unique_ptr type); + StructField(std::string name, std::unique_ptr type) + : name{std::move(name)}, type{std::move(type)} {}; inline bool operator!=(const StructField& other) const { return !(*this == other); } inline std::string getName() const { return name; } diff --git a/src/include/function/list/operations/base_list_sort_operation.h b/src/include/function/list/operations/base_list_sort_operation.h index 297e557a3f..415c0ac5cc 100644 --- a/src/include/function/list/operations/base_list_sort_operation.h +++ b/src/include/function/list/operations/base_list_sort_operation.h @@ -1,5 +1,6 @@ #pragma once +#include "common/string_utils.h" #include "common/vector/value_vector.h" namespace kuzu { @@ -9,7 +10,7 @@ namespace operation { struct BaseListSortOperation { public: static inline bool isAscOrder(const std::string& sortOrder) { - std::string upperSortOrder = toUpperCase(sortOrder); + std::string upperSortOrder = common::StringUtils::toUpperCase(sortOrder); if (upperSortOrder == "ASC") { return true; } else if (upperSortOrder == "DESC") { @@ -20,7 +21,7 @@ struct BaseListSortOperation { } static inline bool isNullFirst(const std::string& nullOrder) { - std::string upperNullOrder = toUpperCase(nullOrder); + std::string upperNullOrder = common::StringUtils::toUpperCase(nullOrder); if (upperNullOrder == "NULLS FIRST") { return true; } else if (upperNullOrder == "NULLS LAST") { @@ -30,12 +31,6 @@ struct BaseListSortOperation { } } - static inline std::string toUpperCase(const std::string& str) { - std::string upperStr = str; - std::transform(upperStr.begin(), upperStr.end(), upperStr.begin(), ::toupper); - return upperStr; - } - template static void sortValues(common::list_entry_t& input, common::list_entry_t& result, common::ValueVector& inputVector, common::ValueVector& resultVector, bool ascOrder, diff --git a/src/processor/mapper/map_path_property_probe.cpp b/src/processor/mapper/map_path_property_probe.cpp index 45f492a08b..ca5a001f0a 100644 --- a/src/processor/mapper/map_path_property_probe.cpp +++ b/src/processor/mapper/map_path_property_probe.cpp @@ -23,7 +23,8 @@ static std::vector getColIdxToScan( std::vector colIndicesToScan; for (auto i = 1u; i < nodeStructFields.size(); ++i) { auto field = nodeStructFields[i]; - colIndicesToScan.push_back(propertyNameToColumnIdx.at(field->getName())); + auto upperFieldName = common::StringUtils::toUpperCase(field->getName()); + colIndicesToScan.push_back(propertyNameToColumnIdx.at(upperFieldName)); } return colIndicesToScan; } diff --git a/test/c_api/connection_test.cpp b/test/c_api/connection_test.cpp index 70765c4903..9cacf58c54 100644 --- a/test/c_api/connection_test.cpp +++ b/test/c_api/connection_test.cpp @@ -173,7 +173,7 @@ TEST_F(CApiConnectionTest, GetNodePropertyNames) { "\tname STRING(PRIMARY KEY)\n" "\tlength INT32\n" "\tnote STRING\n" - "\tdescription STRUCT(RATING:DOUBLE, VIEWS:INT64, RELEASE:TIMESTAMP, FILM:DATE)\n" + "\tdescription STRUCT(rating:DOUBLE, views:INT64, release:TIMESTAMP, film:DATE)\n" "\tcontent BLOB\n"); free(result); } diff --git a/test/c_api/value_test.cpp b/test/c_api/value_test.cpp index 00bf3f55da..5aa3a0c598 100644 --- a/test/c_api/value_test.cpp +++ b/test/c_api/value_test.cpp @@ -322,19 +322,19 @@ TEST_F(CApiValueTest, GetStructFieldName) { auto flatTuple = kuzu_query_result_get_next(result); auto value = kuzu_flat_tuple_get_value(flatTuple, 0); auto fieldName = kuzu_value_get_struct_field_name(value, 0); - ASSERT_STREQ(fieldName, "RATING"); + ASSERT_STREQ(fieldName, "rating"); free(fieldName); fieldName = kuzu_value_get_struct_field_name(value, 1); - ASSERT_STREQ(fieldName, "VIEWS"); + ASSERT_STREQ(fieldName, "views"); free(fieldName); fieldName = kuzu_value_get_struct_field_name(value, 2); - ASSERT_STREQ(fieldName, "RELEASE"); + ASSERT_STREQ(fieldName, "release"); free(fieldName); fieldName = kuzu_value_get_struct_field_name(value, 3); - ASSERT_STREQ(fieldName, "FILM"); + ASSERT_STREQ(fieldName, "film"); free(fieldName); kuzu_value_destroy(value); diff --git a/test/runner/e2e_ddl_test.cpp b/test/runner/e2e_ddl_test.cpp index fd37f5a754..8fd7c8a87d 100644 --- a/test/runner/e2e_ddl_test.cpp +++ b/test/runner/e2e_ddl_test.cpp @@ -831,5 +831,9 @@ TEST_F(TinySnbDDLTest, RenamePropertyRecovery) { renameProperty(TransactionTestType::RECOVERY); } +TEST_F(TinySnbDDLTest, dasd) { + conn->query(" Profile create node table npytable1 (id INT64,i32 INT32, PRIMARY KEY(id));"); +} + } // namespace testing } // namespace kuzu diff --git a/test/test_files/copy/copy_node_parquet.test b/test/test_files/copy/copy_node_parquet.test index 35163cbdf1..5637020d60 100644 --- a/test/test_files/copy/copy_node_parquet.test +++ b/test/test_files/copy/copy_node_parquet.test @@ -8,11 +8,11 @@ -LOG SubsetTest -STATEMENT MATCH (row:tableOfTypes) WHERE row.id >= 20 AND row.id <= 24 RETURN row.id, row.int64Column, row.doubleColumn, row.booleanColumn, row.dateColumn, row.timestampColumn, row.stringColumn, row.listOfInt64, row.listOfString, row.listOfListOfInt64, row.fixedSizeList, row.listOfFixedSizeList, row.structColumn; ---- 5 -20|0|57.579280|True|2094-08-19|1731-09-26 03:30:08|OdM|[85,11,98,6]|[wl7evae,lLtQIMJI,vNvYnjt27]|[[131,129]]|[297,283,26]|[[36,165,199],[182,108,165],[17,120,181],[193,171,93]]|{ID: 717, NAME: 3oOf} -21|7|64.630960|False|2090-07-13|1307-01-26 03:31:08|AjbxHQThEtDDlOjbzMjCQSXlvGQEjcFLykESrnFHwPKX|[53,44,76,78]|[V0yNTz60W2i4J,LN3F2erCELm]|[[191,62],[64,259,183,130,116],[49,29,222,249,128],[222,169,22,80],[206,59]]|[114,108,207]|[[53,135,64],[173,101,155],[173,161,11],[140,113,18]]|{ID: 956, NAME: GNX5sv9V} -22|71|37.963386|True|2048-04-24|1455-07-26 03:07:03|dRvHHdyNXYfSUcicaxBoQEKQUfgex|[74]|[GOLV1]|[[139,156,218],[148,187,62],[158,118],[297,151]]|[258,1,50]|[[34,123,13],[84,122,133]]|{ID: 838, NAME: gRdEkZSI8qQ7dIH} -23|58|42.774957|False|2043-08-19|1181-10-16 18:19:43|ISImRVpUjynGMFRQyYmeIUVjM|[16,38,98,61,2]|[EzPWolZ2iCsga46o,lbhcKq7DDPeiX,yaxsyrbzolAyVWlxj,5Rlse62CKuIitVf4,yKOx0P]|[[95,209,75,7],[197],[69,244],[164,160,153,125]]|[55,59,114]|[[80,52,187],[64,175,142],[148,141,185],[90,51,49]]|{ID: 682, NAME: 06SBnT} -24|75|53.813224|False|1971-12-05|1942-10-24 09:30:16|naDlQ|[94,17,22]|[gVYovI30hQyC,b6OpP]|[[81,66],[255,44],[37]]|[262,288,66]|[[34,178,128]]|{ID: 185, NAME: 7xymBThq} +20|0|57.579280|True|2094-08-19|1731-09-26 03:30:08|OdM|[85,11,98,6]|[wl7evae,lLtQIMJI,vNvYnjt27]|[[131,129]]|[297,283,26]|[[36,165,199],[182,108,165],[17,120,181],[193,171,93]]|{ID: 717, name: 3oOf} +21|7|64.630960|False|2090-07-13|1307-01-26 03:31:08|AjbxHQThEtDDlOjbzMjCQSXlvGQEjcFLykESrnFHwPKX|[53,44,76,78]|[V0yNTz60W2i4J,LN3F2erCELm]|[[191,62],[64,259,183,130,116],[49,29,222,249,128],[222,169,22,80],[206,59]]|[114,108,207]|[[53,135,64],[173,101,155],[173,161,11],[140,113,18]]|{ID: 956, name: GNX5sv9V} +22|71|37.963386|True|2048-04-24|1455-07-26 03:07:03|dRvHHdyNXYfSUcicaxBoQEKQUfgex|[74]|[GOLV1]|[[139,156,218],[148,187,62],[158,118],[297,151]]|[258,1,50]|[[34,123,13],[84,122,133]]|{ID: 838, name: gRdEkZSI8qQ7dIH} +23|58|42.774957|False|2043-08-19|1181-10-16 18:19:43|ISImRVpUjynGMFRQyYmeIUVjM|[16,38,98,61,2]|[EzPWolZ2iCsga46o,lbhcKq7DDPeiX,yaxsyrbzolAyVWlxj,5Rlse62CKuIitVf4,yKOx0P]|[[95,209,75,7],[197],[69,244],[164,160,153,125]]|[55,59,114]|[[80,52,187],[64,175,142],[148,141,185],[90,51,49]]|{ID: 682, name: 06SBnT} +24|75|53.813224|False|1971-12-05|1942-10-24 09:30:16|naDlQ|[94,17,22]|[gVYovI30hQyC,b6OpP]|[[81,66],[255,44],[37]]|[262,288,66]|[[34,178,128]]|{ID: 185, name: 7xymBThq} -LOG CheckNumLinesTest -STATEMENT MATCH (row:tableOfTypes) RETURN count(*) diff --git a/test/test_files/demo_db/demo_db.test b/test/test_files/demo_db/demo_db.test index 835e9213c4..7c108ec3c0 100644 --- a/test/test_files/demo_db/demo_db.test +++ b/test/test_files/demo_db/demo_db.test @@ -114,10 +114,10 @@ Kitchener|2 -LOG ReturnVarLen -STATEMENT MATCH (a:User)-[e:Follows*1..2]->(b:User) WHERE a.name = 'Adam' RETURN b.name, e; ---- 4 -Karissa|{_NODES: [{_ID: 0:0, NAME: Adam, AGE: 30},{_ID: 0:1, NAME: Karissa, AGE: 40}], _RELS: [{_ID: 2:0, SINCE: 2020}]} -Noura|{_NODES: [{_ID: 0:0, NAME: Adam, AGE: 30},{_ID: 0:2, NAME: Zhang, AGE: 50},{_ID: 0:3, NAME: Noura, AGE: 25}], _RELS: [{_ID: 2:1, SINCE: 2020},{_ID: 2:3, SINCE: 2022}]} -Zhang|{_NODES: [{_ID: 0:0, NAME: Adam, AGE: 30},{_ID: 0:1, NAME: Karissa, AGE: 40},{_ID: 0:2, NAME: Zhang, AGE: 50}], _RELS: [{_ID: 2:0, SINCE: 2020},{_ID: 2:2, SINCE: 2021}]} -Zhang|{_NODES: [{_ID: 0:0, NAME: Adam, AGE: 30},{_ID: 0:2, NAME: Zhang, AGE: 50}], _RELS: [{_ID: 2:1, SINCE: 2020}]} +Karissa|{_nodes: [{_id: 0:0, name: Adam, age: 30},{_id: 0:1, name: Karissa, age: 40}], _rels: [{_id: 2:0, since: 2020}]} +Noura|{_nodes: [{_id: 0:0, name: Adam, age: 30},{_id: 0:2, name: Zhang, age: 50},{_id: 0:3, name: Noura, age: 25}], _rels: [{_id: 2:1, since: 2020},{_id: 2:3, since: 2022}]} +Zhang|{_nodes: [{_id: 0:0, name: Adam, age: 30},{_id: 0:1, name: Karissa, age: 40},{_id: 0:2, name: Zhang, age: 50}], _rels: [{_id: 2:0, since: 2020},{_id: 2:2, since: 2021}]} +Zhang|{_nodes: [{_id: 0:0, name: Adam, age: 30},{_id: 0:2, name: Zhang, age: 50}], _rels: [{_id: 2:1, since: 2020}]} -LOG ShortestPath -STATEMENT MATCH (a:User)-[e* SHORTEST 1..4]->(b:City) WHERE a.name = 'Adam' RETURN b.name, length(e) AS length; diff --git a/test/test_files/shortest_path/bfs_sssp.test b/test/test_files/shortest_path/bfs_sssp.test index 4d2b28e05f..fecf95813d 100644 --- a/test/test_files/shortest_path/bfs_sssp.test +++ b/test/test_files/shortest_path/bfs_sssp.test @@ -5,39 +5,39 @@ -CASE Bfs -#Alice|Bob|{_NODES: [0:0,0:1], _RELS: [1:0]} -#Alice|Carol|{_NODES: [0:0,0:2], _RELS: [1:1]} -#Alice|Dan|{_NODES: [0:0,0:3], _RELS: [1:2]} -#Alice|Elizabeth|{_NODES: [0:0,0:1,0:4], _RELS: [1:0,1:6]} -#Alice|Farooq|{_NODES: [0:0,0:1,0:4,0:5], _RELS: [1:0,1:6,1:13]} -#Alice|Greg|{_NODES: [0:0,0:1,0:4,0:6], _RELS: [1:0,1:6,1:14]} -#Alice|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|{_NODES: [0:0,0:1,0:4,0:7], _RELS: [1:0,1:6,1:15]} +#Alice|Bob|{_nodes: [0:0,0:1], _rels: [1:0]} +#Alice|Carol|{_nodes: [0:0,0:2], _rels: [1:1]} +#Alice|Dan|{_nodes: [0:0,0:3], _rels: [1:2]} +#Alice|Elizabeth|{_nodes: [0:0,0:1,0:4], _rels: [1:0,1:6]} +#Alice|Farooq|{_nodes: [0:0,0:1,0:4,0:5], _rels: [1:0,1:6,1:13]} +#Alice|Greg|{_nodes: [0:0,0:1,0:4,0:6], _rels: [1:0,1:6,1:14]} +#Alice|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|{_nodes: [0:0,0:1,0:4,0:7], _rels: [1:0,1:6,1:15]} -LOG SingleSourceAllDestinationsSSP -STATEMENT MATCH (a:person)-[r:knows* SHORTEST 1..30]->(b:person) WHERE a.fName = 'Alice' RETURN a.fName, b.fName, rels(r), (nodes(r)[2]).fName ---- 7 -Alice|Bob|[{_ID: 1:0}]|Bob -Alice|Carol|[{_ID: 1:1}]|Carol -Alice|Dan|[{_ID: 1:2}]|Dan -Alice|Elizabeth|[{_ID: 1:0},{_ID: 1:6}]|Bob -Alice|Farooq|[{_ID: 1:0},{_ID: 1:6},{_ID: 1:13}]|Bob -Alice|Greg|[{_ID: 1:0},{_ID: 1:6},{_ID: 1:14}]|Bob -Alice|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|[{_ID: 1:0},{_ID: 1:6},{_ID: 1:15}]|Bob +Alice|Bob|[{_id: 1:0}]|Bob +Alice|Carol|[{_id: 1:1}]|Carol +Alice|Dan|[{_id: 1:2}]|Dan +Alice|Elizabeth|[{_id: 1:0},{_id: 1:6}]|Bob +Alice|Farooq|[{_id: 1:0},{_id: 1:6},{_id: 1:13}]|Bob +Alice|Greg|[{_id: 1:0},{_id: 1:6},{_id: 1:14}]|Bob +Alice|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|[{_id: 1:0},{_id: 1:6},{_id: 1:15}]|Bob -#Bob|Alice|{_NODES: [0:0,0:1], _RELS: [1:3]} -#Carol|Alice|{_NODES: [0:0,0:2], _RELS: [1:7]} -#Dan|Alice|{_NODES: [0:0,0:3], _RELS: [1:10]} -#Elizabeth|Alice|{_NODES: [0:0,0:7,0:4], _RELS: [1:20,1:15]} -#Farooq|Alice|{_NODES: [0:0,0:7,0:5], _RELS: [1:20,1:17]} -#Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|Alice|{_NODES: [0:0,0:7], _RELS: [1:20]} +#Bob|Alice|{_nodes: [0:0,0:1], _rels: [1:3]} +#Carol|Alice|{_nodes: [0:0,0:2], _rels: [1:7]} +#Dan|Alice|{_nodes: [0:0,0:3], _rels: [1:10]} +#Elizabeth|Alice|{_nodes: [0:0,0:7,0:4], _rels: [1:20,1:15]} +#Farooq|Alice|{_nodes: [0:0,0:7,0:5], _rels: [1:20,1:17]} +#Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|Alice|{_nodes: [0:0,0:7], _rels: [1:20]} -LOG AllSourcesSingleDestinationQuery -STATEMENT MATCH (a:person)-[r:knows* SHORTEST 1..30]->(b:person) WHERE b.fName = 'Alice' RETURN a.fName, b.fName, rels(r), (nodes(r)[2]).fName ---- 6 -Bob|Alice|[{_ID: 1:3}]|Bob -Carol|Alice|[{_ID: 1:7}]|Carol -Dan|Alice|[{_ID: 1:10}]|Dan -Elizabeth|Alice|[{_ID: 1:20},{_ID: 1:15}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff -Farooq|Alice|[{_ID: 1:20},{_ID: 1:17}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff -Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|Alice|[{_ID: 1:20}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff +Bob|Alice|[{_id: 1:3}]|Bob +Carol|Alice|[{_id: 1:7}]|Carol +Dan|Alice|[{_id: 1:10}]|Dan +Elizabeth|Alice|[{_id: 1:20},{_id: 1:15}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff +Farooq|Alice|[{_id: 1:20},{_id: 1:17}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff +Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|Alice|[{_id: 1:20}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff -LOG SingleSourceWithAllProperties @@ -56,19 +56,19 @@ Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|Alice|[{_ID: 1:20}]|Hubert Bla ---- 1 Alice|Bob|1 -#Elizabeth|Alice|{_NODES: [0:4,0:7,0:0], _RELS: [1:15,1:20]} -#Elizabeth|Dan|{_NODES: [0:4,0:7,0:3], _RELS: [1:15,1:21]} -#Elizabeth|Farooq|{_NODES: [0:4,0:5], _RELS: [1:13]} -#Elizabeth|Greg|{_NODES: [0:4,0:6], _RELS: [1:14]} -#Elizabeth|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|{_NODES: [0:4,0:7], _RELS: [1:15]} +#Elizabeth|Alice|{_nodes: [0:4,0:7,0:0], _rels: [1:15,1:20]} +#Elizabeth|Dan|{_nodes: [0:4,0:7,0:3], _rels: [1:15,1:21]} +#Elizabeth|Farooq|{_nodes: [0:4,0:5], _rels: [1:13]} +#Elizabeth|Greg|{_nodes: [0:4,0:6], _rels: [1:14]} +#Elizabeth|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|{_nodes: [0:4,0:7], _rels: [1:15]} -LOG SingleSourceAllDestinations2 -STATEMENT MATCH (a:person)-[r:knows* SHORTEST 1..2]->(b:person) WHERE a.fName = 'Elizabeth' RETURN a.fName, b.fName, rels(r), (nodes(r)[2]).fName ---- 5 -Elizabeth|Alice|[{_ID: 1:15},{_ID: 1:20}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff -Elizabeth|Dan|[{_ID: 1:15},{_ID: 1:21}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff -Elizabeth|Farooq|[{_ID: 1:13}]|Farooq -Elizabeth|Greg|[{_ID: 1:14}]|Greg -Elizabeth|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|[{_ID: 1:15}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff +Elizabeth|Alice|[{_id: 1:15},{_id: 1:20}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff +Elizabeth|Dan|[{_id: 1:15},{_id: 1:21}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff +Elizabeth|Farooq|[{_id: 1:13}]|Farooq +Elizabeth|Greg|[{_id: 1:14}]|Greg +Elizabeth|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff|[{_id: 1:15}]|Hubert Blaine Wolfeschlegelsteinhausenbergerdorff -LOG SingleSourceUnreachableDestination diff --git a/test/test_files/tinysnb/function/map.test b/test/test_files/tinysnb/function/map.test index 06336ae9ae..a7b0a2b5b4 100644 --- a/test/test_files/tinysnb/function/map.test +++ b/test/test_files/tinysnb/function/map.test @@ -87,7 +87,7 @@ -LOG MapValues -STATEMENT RETURN map_values(map([23, 57, 1444], [{a: 5, c: [3, 4, 13]}, {d: 7, e: [1, 2, 3]}, {f: 9, g: [1, 2, 3, 4]}])); ---- 1 -[{A: 5, C: [3,4,13]},{A: 7, C: [1,2,3]},{A: 9, C: [1,2,3,4]}] +[{a: 5, c: [3,4,13]},{a: 7, c: [1,2,3]},{a: 9, c: [1,2,3,4]}] -LOG EmptyMapValues -STATEMENT RETURN map_values(map([], [])); diff --git a/test/test_files/tinysnb/function/table.test b/test/test_files/tinysnb/function/table.test index 6fd7f4d160..15fd98f5d6 100644 --- a/test/test_files/tinysnb/function/table.test +++ b/test/test_files/tinysnb/function/table.test @@ -54,18 +54,18 @@ height -LOG ReturnRelName -STATEMENT MATCH (m:movies) CALL table_info('knows') return m, type ---- 12 -(label:movies, 2:0, {name:Sóló cón tu párejâ, length:126, note: this is a very very good movie, description:{RATING: 5.300000, VIEWS: 152, RELEASE: 2011-08-20 11:25:30, FILM: 2012-05-11}, content:\xAA\xABinteresting\x0B})|DATE -(label:movies, 2:0, {name:Sóló cón tu párejâ, length:126, note: this is a very very good movie, description:{RATING: 5.300000, VIEWS: 152, RELEASE: 2011-08-20 11:25:30, FILM: 2012-05-11}, content:\xAA\xABinteresting\x0B})|TIMESTAMP -(label:movies, 2:0, {name:Sóló cón tu párejâ, length:126, note: this is a very very good movie, description:{RATING: 5.300000, VIEWS: 152, RELEASE: 2011-08-20 11:25:30, FILM: 2012-05-11}, content:\xAA\xABinteresting\x0B})|INTERVAL -(label:movies, 2:0, {name:Sóló cón tu párejâ, length:126, note: this is a very very good movie, description:{RATING: 5.300000, VIEWS: 152, RELEASE: 2011-08-20 11:25:30, FILM: 2012-05-11}, content:\xAA\xABinteresting\x0B})|STRING[] -(label:movies, 2:1, {name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length:2544, note: the movie is very very good, description:{RATING: 7.000000, VIEWS: 982, RELEASE: 2018-11-13 13:33:11, FILM: 2014-09-12}, content:\xAB\xCD})|DATE -(label:movies, 2:1, {name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length:2544, note: the movie is very very good, description:{RATING: 7.000000, VIEWS: 982, RELEASE: 2018-11-13 13:33:11, FILM: 2014-09-12}, content:\xAB\xCD})|TIMESTAMP -(label:movies, 2:1, {name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length:2544, note: the movie is very very good, description:{RATING: 7.000000, VIEWS: 982, RELEASE: 2018-11-13 13:33:11, FILM: 2014-09-12}, content:\xAB\xCD})|INTERVAL -(label:movies, 2:1, {name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length:2544, note: the movie is very very good, description:{RATING: 7.000000, VIEWS: 982, RELEASE: 2018-11-13 13:33:11, FILM: 2014-09-12}, content:\xAB\xCD})|STRING[] -(label:movies, 2:2, {name:Roma, length:298, note:the movie is very interesting and funny, description:{RATING: 1223.000000, VIEWS: 10003, RELEASE: 2011-02-11 16:44:22, FILM: 2013-02-22}, content:pure ascii characters})|DATE -(label:movies, 2:2, {name:Roma, length:298, note:the movie is very interesting and funny, description:{RATING: 1223.000000, VIEWS: 10003, RELEASE: 2011-02-11 16:44:22, FILM: 2013-02-22}, content:pure ascii characters})|TIMESTAMP -(label:movies, 2:2, {name:Roma, length:298, note:the movie is very interesting and funny, description:{RATING: 1223.000000, VIEWS: 10003, RELEASE: 2011-02-11 16:44:22, FILM: 2013-02-22}, content:pure ascii characters})|INTERVAL -(label:movies, 2:2, {name:Roma, length:298, note:the movie is very interesting and funny, description:{RATING: 1223.000000, VIEWS: 10003, RELEASE: 2011-02-11 16:44:22, FILM: 2013-02-22}, content:pure ascii characters})|STRING[] +(label:movies, 2:0, {name:Sóló cón tu párejâ, length:126, note: this is a very very good movie, description:{rating: 5.300000, views: 152, release: 2011-08-20 11:25:30, film: 2012-05-11}, content:\xAA\xABinteresting\x0B})|DATE +(label:movies, 2:0, {name:Sóló cón tu párejâ, length:126, note: this is a very very good movie, description:{rating: 5.300000, views: 152, release: 2011-08-20 11:25:30, film: 2012-05-11}, content:\xAA\xABinteresting\x0B})|TIMESTAMP +(label:movies, 2:0, {name:Sóló cón tu párejâ, length:126, note: this is a very very good movie, description:{rating: 5.300000, views: 152, release: 2011-08-20 11:25:30, film: 2012-05-11}, content:\xAA\xABinteresting\x0B})|INTERVAL +(label:movies, 2:0, {name:Sóló cón tu párejâ, length:126, note: this is a very very good movie, description:{rating: 5.300000, views: 152, release: 2011-08-20 11:25:30, film: 2012-05-11}, content:\xAA\xABinteresting\x0B})|STRING[] +(label:movies, 2:1, {name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length:2544, note: the movie is very very good, description:{rating: 7.000000, views: 982, release: 2018-11-13 13:33:11, film: 2014-09-12}, content:\xAB\xCD})|DATE +(label:movies, 2:1, {name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length:2544, note: the movie is very very good, description:{rating: 7.000000, views: 982, release: 2018-11-13 13:33:11, film: 2014-09-12}, content:\xAB\xCD})|TIMESTAMP +(label:movies, 2:1, {name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length:2544, note: the movie is very very good, description:{rating: 7.000000, views: 982, release: 2018-11-13 13:33:11, film: 2014-09-12}, content:\xAB\xCD})|INTERVAL +(label:movies, 2:1, {name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length:2544, note: the movie is very very good, description:{rating: 7.000000, views: 982, release: 2018-11-13 13:33:11, film: 2014-09-12}, content:\xAB\xCD})|STRING[] +(label:movies, 2:2, {name:Roma, length:298, note:the movie is very interesting and funny, description:{rating: 1223.000000, views: 10003, release: 2011-02-11 16:44:22, film: 2013-02-22}, content:pure ascii characters})|DATE +(label:movies, 2:2, {name:Roma, length:298, note:the movie is very interesting and funny, description:{rating: 1223.000000, views: 10003, release: 2011-02-11 16:44:22, film: 2013-02-22}, content:pure ascii characters})|TIMESTAMP +(label:movies, 2:2, {name:Roma, length:298, note:the movie is very interesting and funny, description:{rating: 1223.000000, views: 10003, release: 2011-02-11 16:44:22, film: 2013-02-22}, content:pure ascii characters})|INTERVAL +(label:movies, 2:2, {name:Roma, length:298, note:the movie is very interesting and funny, description:{rating: 1223.000000, views: 10003, release: 2011-02-11 16:44:22, film: 2013-02-22}, content:pure ascii characters})|STRING[] -CASE NodeTableWith300ColumnsInfo -DEFINE COLS REPEAT 2400 "col${count} INT64," diff --git a/test/test_files/tinysnb/function/union.test b/test/test_files/tinysnb/function/union.test index 9d8513d776..c1bdff3b10 100644 --- a/test/test_files/tinysnb/function/union.test +++ b/test/test_files/tinysnb/function/union.test @@ -43,30 +43,30 @@ -LOG UnionTagOnLiteral -STATEMENT RETURN union_tag(union_value(numTuples := 100)) ---- 1 -NUMTUPLES +numTuples -LOG UnionTagOnLongString -STATEMENT RETURN union_tag(union_value(longStringField := "This is a long string")) ---- 1 -LONGSTRINGFIELD +longStringField -LOG UnionTagOnExpr -STATEMENT MATCH (p:person)-[:knows]->(p1:person) return union_tag(union_value(age := p.age)), union_tag(union_value(PERSON_id := p1.ID)) ---- 14 -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID -AGE|PERSON_ID +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id +age|PERSON_id -LOG UnionExtractOnLiteral -STATEMENT RETURN union_extract(union_value(numTuples := 100), 'numTuples') diff --git a/test/test_files/tinysnb/projection/multi_label.test b/test/test_files/tinysnb/projection/multi_label.test index 56522eaed6..8a97a3596a 100644 --- a/test/test_files/tinysnb/projection/multi_label.test +++ b/test/test_files/tinysnb/projection/multi_label.test @@ -30,9 +30,9 @@ -LOG MultiLabelReturnStar -STATEMENT MATCH (a:movies:organisation) RETURN * ---- 6 -(label:movies, 2:0, {ID:, name:Sóló cón tu párejâ, orgCode:, mark:, score:, history:, licenseValidInterval:, rating:, state:, length:126, note: this is a very very good movie, description:{RATING: 5.300000, VIEWS: 152, RELEASE: 2011-08-20 11:25:30, FILM: 2012-05-11}, content:\xAA\xABinteresting\x0B}) -(label:movies, 2:1, {ID:, name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, orgCode:, mark:, score:, history:, licenseValidInterval:, rating:, state:, length:2544, note: the movie is very very good, description:{RATING: 7.000000, VIEWS: 982, RELEASE: 2018-11-13 13:33:11, FILM: 2014-09-12}, content:\xAB\xCD}) -(label:movies, 2:2, {ID:, name:Roma, orgCode:, mark:, score:, history:, licenseValidInterval:, rating:, state:, length:298, note:the movie is very interesting and funny, description:{RATING: 1223.000000, VIEWS: 10003, RELEASE: 2011-02-11 16:44:22, FILM: 2013-02-22}, content:pure ascii characters}) -(label:organisation, 1:0, {ID:1, name:ABFsUni, orgCode:325, mark:3.700000, score:-2, history:10 years 5 months 13 hours 24 us, licenseValidInterval:3 years 5 days, rating:1.000000, state:{REVENUE: 138, LOCATION: ['toronto', 'montr,eal'], STOCK: {PRICE: [96,56], VOLUME: 1000}}, length:, note:, description:, content:}) -(label:organisation, 1:1, {ID:4, name:CsWork, orgCode:934, mark:4.100000, score:-100, history:2 years 4 days 10 hours, licenseValidInterval:26 years 52 days 48:00:00, rating:0.780000, state:{REVENUE: 152, LOCATION: ["vanco,uver north area"], STOCK: {PRICE: [15,78,671], VOLUME: 432}}, length:, note:, description:, content:}) -(label:organisation, 1:2, {ID:6, name:DEsWork, orgCode:824, mark:4.100000, score:7, history:2 years 4 hours 22 us 34 minutes, licenseValidInterval:82:00:00.1, rating:0.520000, state:{REVENUE: 558, LOCATION: ['very long city name', 'new york'], STOCK: {PRICE: [22], VOLUME: 99}}, length:, note:, description:, content:}) +(label:movies, 2:0, {ID:, name:Sóló cón tu párejâ, orgCode:, mark:, score:, history:, licenseValidInterval:, rating:, state:, length:126, note: this is a very very good movie, description:{rating: 5.300000, views: 152, release: 2011-08-20 11:25:30, film: 2012-05-11}, content:\xAA\xABinteresting\x0B}) +(label:movies, 2:1, {ID:, name:The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, orgCode:, mark:, score:, history:, licenseValidInterval:, rating:, state:, length:2544, note: the movie is very very good, description:{rating: 7.000000, views: 982, release: 2018-11-13 13:33:11, film: 2014-09-12}, content:\xAB\xCD}) +(label:movies, 2:2, {ID:, name:Roma, orgCode:, mark:, score:, history:, licenseValidInterval:, rating:, state:, length:298, note:the movie is very interesting and funny, description:{rating: 1223.000000, views: 10003, release: 2011-02-11 16:44:22, film: 2013-02-22}, content:pure ascii characters}) +(label:organisation, 1:0, {ID:1, name:ABFsUni, orgCode:325, mark:3.700000, score:-2, history:10 years 5 months 13 hours 24 us, licenseValidInterval:3 years 5 days, rating:1.000000, state:{revenue: 138, location: ['toronto', 'montr,eal'], stock: {price: [96,56], volume: 1000}}, length:, note:, description:, content:}) +(label:organisation, 1:1, {ID:4, name:CsWork, orgCode:934, mark:4.100000, score:-100, history:2 years 4 days 10 hours, licenseValidInterval:26 years 52 days 48:00:00, rating:0.780000, state:{revenue: 152, location: ["vanco,uver north area"], stock: {price: [15,78,671], volume: 432}}, length:, note:, description:, content:}) +(label:organisation, 1:2, {ID:6, name:DEsWork, orgCode:824, mark:4.100000, score:7, history:2 years 4 hours 22 us 34 minutes, licenseValidInterval:82:00:00.1, rating:0.520000, state:{revenue: 558, location: ['very long city name', 'new york'], stock: {price: [22], volume: 99}}, length:, note:, description:, content:}) diff --git a/test/test_files/tinysnb/projection/single_label.test b/test/test_files/tinysnb/projection/single_label.test index 10c2b51801..df9e33fc45 100644 --- a/test/test_files/tinysnb/projection/single_label.test +++ b/test/test_files/tinysnb/projection/single_label.test @@ -39,9 +39,9 @@ False|| -LOG OrgNodesReturnStarTest -STATEMENT MATCH (a:organisation) RETURN * ---- 3 -(label:organisation, 1:0, {ID:1, name:ABFsUni, orgCode:325, mark:3.700000, score:-2, history:10 years 5 months 13 hours 24 us, licenseValidInterval:3 years 5 days, rating:1.000000, state:{REVENUE: 138, LOCATION: ['toronto', 'montr,eal'], STOCK: {PRICE: [96,56], VOLUME: 1000}}}) -(label:organisation, 1:1, {ID:4, name:CsWork, orgCode:934, mark:4.100000, score:-100, history:2 years 4 days 10 hours, licenseValidInterval:26 years 52 days 48:00:00, rating:0.780000, state:{REVENUE: 152, LOCATION: ["vanco,uver north area"], STOCK: {PRICE: [15,78,671], VOLUME: 432}}}) -(label:organisation, 1:2, {ID:6, name:DEsWork, orgCode:824, mark:4.100000, score:7, history:2 years 4 hours 22 us 34 minutes, licenseValidInterval:82:00:00.1, rating:0.520000, state:{REVENUE: 558, LOCATION: ['very long city name', 'new york'], STOCK: {PRICE: [22], VOLUME: 99}}}) +(label:organisation, 1:0, {ID:1, name:ABFsUni, orgCode:325, mark:3.700000, score:-2, history:10 years 5 months 13 hours 24 us, licenseValidInterval:3 years 5 days, rating:1.000000, state:{revenue: 138, location: ['toronto', 'montr,eal'], stock: {price: [96,56], volume: 1000}}}) +(label:organisation, 1:1, {ID:4, name:CsWork, orgCode:934, mark:4.100000, score:-100, history:2 years 4 days 10 hours, licenseValidInterval:26 years 52 days 48:00:00, rating:0.780000, state:{revenue: 152, location: ["vanco,uver north area"], stock: {price: [15,78,671], volume: 432}}}) +(label:organisation, 1:2, {ID:6, name:DEsWork, orgCode:824, mark:4.100000, score:7, history:2 years 4 hours 22 us 34 minutes, licenseValidInterval:82:00:00.1, rating:0.520000, state:{revenue: 558, location: ['very long city name', 'new york'], stock: {price: [22], volume: 99}}}) -LOG PersonNodesTestNull -STATEMENT MATCH (a:person) RETURN a.ID, a.fName STARTS WITH NULL, a.isWorker, a.isWorker AND null @@ -453,7 +453,7 @@ Dan|Carol -LOG ReturnStructLiteral -STATEMENT RETURN {weight: 1.8, age: 42, name: "Mark", grades: [1,2,3]} ---- 1 -{WEIGHT: 1.800000, AGE: 42, NAME: Mark, GRADES: [1,2,3]} +{weight: 1.800000, age: 42, name: Mark, grades: [1,2,3]} -LOG ReturnStructLiteral2 -STATEMENT WITH {a: '1', b: 2, c: [4,5,6]} AS st RETURN st.a, st.b * 5, (st.c)[1:3] @@ -463,79 +463,79 @@ Dan|Carol -LOG ReturnStructLiteralWithNull -STATEMENT RETURN {info: {name: "AliceBobCarolDan", gender: "female", hobby: null}, height: 1.8, age: null} ---- 1 -{INFO: {NAME: AliceBobCarolDan, GENDER: female, HOBBY: }, HEIGHT: 1.800000, AGE: } +{info: {name: AliceBobCarolDan, gender: female, hobby: }, height: 1.800000, age: } -LOG ReturnStructListLiteralWithNull -STATEMENT RETURN {info: {name: "smith", gender: null, hobby: [null, "footBall"]}, height: 1.8, age: null} ---- 1 -{INFO: {NAME: smith, GENDER: , HOBBY: [,footBall]}, HEIGHT: 1.800000, AGE: } +{info: {name: smith, gender: , hobby: [,footBall]}, height: 1.800000, age: } -LOG ReturnStruct -STATEMENT MATCH (m:movies) RETURN m.description ---- 3 -{RATING: 1223.000000, VIEWS: 10003, RELEASE: 2011-02-11 16:44:22, FILM: 2013-02-22} -{RATING: 5.300000, VIEWS: 152, RELEASE: 2011-08-20 11:25:30, FILM: 2012-05-11} -{RATING: 7.000000, VIEWS: 982, RELEASE: 2018-11-13 13:33:11, FILM: 2014-09-12} +{rating: 1223.000000, views: 10003, release: 2011-02-11 16:44:22, film: 2013-02-22} +{rating: 5.300000, views: 152, release: 2011-08-20 11:25:30, film: 2012-05-11} +{rating: 7.000000, views: 982, release: 2018-11-13 13:33:11, film: 2014-09-12} -LOG ReturnStructLiteralWithUnflatFlatChildren -STATEMENT MATCH (p:person)-[e:knows]->(p1:person) return {name: p.fName, id: p1.ID, date: e.date} ---- 14 -{NAME: Alice, ID: 2, DATE: 2021-06-30} -{NAME: Alice, ID: 3, DATE: 2021-06-30} -{NAME: Alice, ID: 5, DATE: 2021-06-30} -{NAME: Bob, ID: 0, DATE: 2021-06-30} -{NAME: Bob, ID: 3, DATE: 1950-05-14} -{NAME: Bob, ID: 5, DATE: 1950-05-14} -{NAME: Carol, ID: 0, DATE: 2021-06-30} -{NAME: Carol, ID: 2, DATE: 1950-05-14} -{NAME: Carol, ID: 5, DATE: 2000-01-01} -{NAME: Dan, ID: 0, DATE: 2021-06-30} -{NAME: Dan, ID: 2, DATE: 1950-05-14} -{NAME: Dan, ID: 3, DATE: 2000-01-01} -{NAME: Elizabeth, ID: 8, DATE: 1905-12-12} -{NAME: Elizabeth, ID: 9, DATE: 1905-12-12} +{name: Alice, id: 2, date: 2021-06-30} +{name: Alice, id: 3, date: 2021-06-30} +{name: Alice, id: 5, date: 2021-06-30} +{name: Bob, id: 0, date: 2021-06-30} +{name: Bob, id: 3, date: 1950-05-14} +{name: Bob, id: 5, date: 1950-05-14} +{name: Carol, id: 0, date: 2021-06-30} +{name: Carol, id: 2, date: 1950-05-14} +{name: Carol, id: 5, date: 2000-01-01} +{name: Dan, id: 0, date: 2021-06-30} +{name: Dan, id: 2, date: 1950-05-14} +{name: Dan, id: 3, date: 2000-01-01} +{name: Elizabeth, id: 8, date: 1905-12-12} +{name: Elizabeth, id: 9, date: 1905-12-12} -LOG ReturnNestedStructLiteral -STATEMENT MATCH (p:person) return {description: {gender: p.gender, age: p.age}, name: p.fName} ---- 8 -{DESCRIPTION: {GENDER: 1, AGE: 20}, NAME: Elizabeth} -{DESCRIPTION: {GENDER: 1, AGE: 35}, NAME: Alice} -{DESCRIPTION: {GENDER: 1, AGE: 45}, NAME: Carol} -{DESCRIPTION: {GENDER: 2, AGE: 20}, NAME: Dan} -{DESCRIPTION: {GENDER: 2, AGE: 25}, NAME: Farooq} -{DESCRIPTION: {GENDER: 2, AGE: 30}, NAME: Bob} -{DESCRIPTION: {GENDER: 2, AGE: 40}, NAME: Greg} -{DESCRIPTION: {GENDER: 2, AGE: 83}, NAME: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff} +{description: {gender: 1, age: 20}, name: Elizabeth} +{description: {gender: 1, age: 35}, name: Alice} +{description: {gender: 1, age: 45}, name: Carol} +{description: {gender: 2, age: 20}, name: Dan} +{description: {gender: 2, age: 25}, name: Farooq} +{description: {gender: 2, age: 30}, name: Bob} +{description: {gender: 2, age: 40}, name: Greg} +{description: {gender: 2, age: 83}, name: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff} -LOG ReturnNestedListOfStructLiteral -STATEMENT MATCH (p:person) return [{description: {propA: p.gender, propB: [p.age, 10]}, name: p.fName}, {description: {propA: p.ID, propB: [p.gender, 20]}, name: p.fName}] ---- 8 -[{DESCRIPTION: {PROPA: 1, PROPB: [35,10]}, NAME: Alice},{DESCRIPTION: {PROPA: 0, PROPB: [1,20]}, NAME: Alice}] -[{DESCRIPTION: {PROPA: 2, PROPB: [30,10]}, NAME: Bob},{DESCRIPTION: {PROPA: 2, PROPB: [2,20]}, NAME: Bob}] -[{DESCRIPTION: {PROPA: 1, PROPB: [45,10]}, NAME: Carol},{DESCRIPTION: {PROPA: 3, PROPB: [1,20]}, NAME: Carol}] -[{DESCRIPTION: {PROPA: 2, PROPB: [20,10]}, NAME: Dan},{DESCRIPTION: {PROPA: 5, PROPB: [2,20]}, NAME: Dan}] -[{DESCRIPTION: {PROPA: 1, PROPB: [20,10]}, NAME: Elizabeth},{DESCRIPTION: {PROPA: 7, PROPB: [1,20]}, NAME: Elizabeth}] -[{DESCRIPTION: {PROPA: 2, PROPB: [25,10]}, NAME: Farooq},{DESCRIPTION: {PROPA: 8, PROPB: [2,20]}, NAME: Farooq}] -[{DESCRIPTION: {PROPA: 2, PROPB: [40,10]}, NAME: Greg},{DESCRIPTION: {PROPA: 9, PROPB: [2,20]}, NAME: Greg}] -[{DESCRIPTION: {PROPA: 2, PROPB: [83,10]}, NAME: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff},{DESCRIPTION: {PROPA: 10, PROPB: [2,20]}, NAME: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff}] +[{description: {propA: 1, propB: [35,10]}, name: Alice},{description: {propA: 0, propB: [1,20]}, name: Alice}] +[{description: {propA: 2, propB: [30,10]}, name: Bob},{description: {propA: 2, propB: [2,20]}, name: Bob}] +[{description: {propA: 1, propB: [45,10]}, name: Carol},{description: {propA: 3, propB: [1,20]}, name: Carol}] +[{description: {propA: 2, propB: [20,10]}, name: Dan},{description: {propA: 5, propB: [2,20]}, name: Dan}] +[{description: {propA: 1, propB: [20,10]}, name: Elizabeth},{description: {propA: 7, propB: [1,20]}, name: Elizabeth}] +[{description: {propA: 2, propB: [25,10]}, name: Farooq},{description: {propA: 8, propB: [2,20]}, name: Farooq}] +[{description: {propA: 2, propB: [40,10]}, name: Greg},{description: {propA: 9, propB: [2,20]}, name: Greg}] +[{description: {propA: 2, propB: [83,10]}, name: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff},{description: {propA: 10, propB: [2,20]}, name: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff}] -LOG ReturnNestedListOfStructWithUnflatFlatChildren -STATEMENT MATCH (p1:person)-[e:knows]->(p2:person) return [{description: {propA: [p1.gender, p2.gender], propB: e.date}, name: p1.fName}, {description: {propA: [p1.ID, p2.ID], propB: p1.birthdate}, name: p2.fName}] ---- 14 -[{DESCRIPTION: {PROPA: [1,2], PROPB: 2021-06-30}, NAME: Alice},{DESCRIPTION: {PROPA: [0,2], PROPB: 1900-01-01}, NAME: Bob}] -[{DESCRIPTION: {PROPA: [1,1], PROPB: 2021-06-30}, NAME: Alice},{DESCRIPTION: {PROPA: [0,3], PROPB: 1900-01-01}, NAME: Carol}] -[{DESCRIPTION: {PROPA: [1,2], PROPB: 2021-06-30}, NAME: Alice},{DESCRIPTION: {PROPA: [0,5], PROPB: 1900-01-01}, NAME: Dan}] -[{DESCRIPTION: {PROPA: [2,1], PROPB: 2021-06-30}, NAME: Bob},{DESCRIPTION: {PROPA: [2,0], PROPB: 1900-01-01}, NAME: Alice}] -[{DESCRIPTION: {PROPA: [2,1], PROPB: 1950-05-14}, NAME: Bob},{DESCRIPTION: {PROPA: [2,3], PROPB: 1900-01-01}, NAME: Carol}] -[{DESCRIPTION: {PROPA: [2,2], PROPB: 1950-05-14}, NAME: Bob},{DESCRIPTION: {PROPA: [2,5], PROPB: 1900-01-01}, NAME: Dan}] -[{DESCRIPTION: {PROPA: [1,1], PROPB: 2021-06-30}, NAME: Carol},{DESCRIPTION: {PROPA: [3,0], PROPB: 1940-06-22}, NAME: Alice}] -[{DESCRIPTION: {PROPA: [1,2], PROPB: 1950-05-14}, NAME: Carol},{DESCRIPTION: {PROPA: [3,2], PROPB: 1940-06-22}, NAME: Bob}] -[{DESCRIPTION: {PROPA: [1,2], PROPB: 2000-01-01}, NAME: Carol},{DESCRIPTION: {PROPA: [3,5], PROPB: 1940-06-22}, NAME: Dan}] -[{DESCRIPTION: {PROPA: [2,1], PROPB: 2021-06-30}, NAME: Dan},{DESCRIPTION: {PROPA: [5,0], PROPB: 1950-07-23}, NAME: Alice}] -[{DESCRIPTION: {PROPA: [2,2], PROPB: 1950-05-14}, NAME: Dan},{DESCRIPTION: {PROPA: [5,2], PROPB: 1950-07-23}, NAME: Bob}] -[{DESCRIPTION: {PROPA: [2,1], PROPB: 2000-01-01}, NAME: Dan},{DESCRIPTION: {PROPA: [5,3], PROPB: 1950-07-23}, NAME: Carol}] -[{DESCRIPTION: {PROPA: [1,2], PROPB: 1905-12-12}, NAME: Elizabeth},{DESCRIPTION: {PROPA: [7,8], PROPB: 1980-10-26}, NAME: Farooq}] -[{DESCRIPTION: {PROPA: [1,2], PROPB: 1905-12-12}, NAME: Elizabeth},{DESCRIPTION: {PROPA: [7,9], PROPB: 1980-10-26}, NAME: Greg}] +[{description: {propA: [1,2], propB: 2021-06-30}, name: Alice},{description: {propA: [0,2], propB: 1900-01-01}, name: Bob}] +[{description: {propA: [1,1], propB: 2021-06-30}, name: Alice},{description: {propA: [0,3], propB: 1900-01-01}, name: Carol}] +[{description: {propA: [1,2], propB: 2021-06-30}, name: Alice},{description: {propA: [0,5], propB: 1900-01-01}, name: Dan}] +[{description: {propA: [2,1], propB: 2021-06-30}, name: Bob},{description: {propA: [2,0], propB: 1900-01-01}, name: Alice}] +[{description: {propA: [2,1], propB: 1950-05-14}, name: Bob},{description: {propA: [2,3], propB: 1900-01-01}, name: Carol}] +[{description: {propA: [2,2], propB: 1950-05-14}, name: Bob},{description: {propA: [2,5], propB: 1900-01-01}, name: Dan}] +[{description: {propA: [1,1], propB: 2021-06-30}, name: Carol},{description: {propA: [3,0], propB: 1940-06-22}, name: Alice}] +[{description: {propA: [1,2], propB: 1950-05-14}, name: Carol},{description: {propA: [3,2], propB: 1940-06-22}, name: Bob}] +[{description: {propA: [1,2], propB: 2000-01-01}, name: Carol},{description: {propA: [3,5], propB: 1940-06-22}, name: Dan}] +[{description: {propA: [2,1], propB: 2021-06-30}, name: Dan},{description: {propA: [5,0], propB: 1950-07-23}, name: Alice}] +[{description: {propA: [2,2], propB: 1950-05-14}, name: Dan},{description: {propA: [5,2], propB: 1950-07-23}, name: Bob}] +[{description: {propA: [2,1], propB: 2000-01-01}, name: Dan},{description: {propA: [5,3], propB: 1950-07-23}, name: Carol}] +[{description: {propA: [1,2], propB: 1905-12-12}, name: Elizabeth},{description: {propA: [7,8], propB: 1980-10-26}, name: Farooq}] +[{description: {propA: [1,2], propB: 1905-12-12}, name: Elizabeth},{description: {propA: [7,9], propB: 1980-10-26}, name: Greg}] -LOG ReturnMapLiteral -STATEMENT RETURN map(['Alice', 'Bob', 'Carol', 'Dan'], [20, 34, 50, 22]); diff --git a/test/test_files/tinysnb/var_length_extend/multi_label.test b/test/test_files/tinysnb/var_length_extend/multi_label.test index b486c1dd2d..2f324d5237 100644 --- a/test/test_files/tinysnb/var_length_extend/multi_label.test +++ b/test/test_files/tinysnb/var_length_extend/multi_label.test @@ -75,7 +75,7 @@ ---- 1 5 - +-LOG MixMultiLabelTest5 -STATEMENT MATCH (a:person)-[e*2..2 (r, _ | WHERE offset(id(r)) > 0)]->(b:organisation) WHERE a.fName = 'Alice' RETURN rels(e) ---- 1 -[{_ID: 3:2, DATE: 2021-06-30, MEETTIME: 2012-12-11 20:07:22, VALIDINTERVAL: 10 days, COMMENTS: [ioji232,jifhe8w99u43434], YEAR: , PLACES: , LENGTH: , GRADING: , RATING: , LOCATION: , TIMES: , DATA: , USEDADDRESS: , ADDRESS: , NOTE: },{_ID: 5:1, DATE: , MEETTIME: , VALIDINTERVAL: , COMMENTS: , YEAR: 2010, PLACES: , LENGTH: , GRADING: [2.100000,4.400000], RATING: 7.600000, LOCATION: , TIMES: , DATA: , USEDADDRESS: , ADDRESS: , NOTE: }] +[{_id: 3:2, date: 2021-06-30, meetTime: 2012-12-11 20:07:22, validInterval: 10 days, comments: [ioji232,jifhe8w99u43434], year: , places: , length: , grading: , rating: , location: , times: , data: , usedAddress: , address: , note: },{_id: 5:1, date: , meetTime: , validInterval: , comments: , year: 2010, places: , length: , grading: [2.100000,4.400000], rating: 7.600000, location: , times: , data: , usedAddress: , address: , note: }] diff --git a/tools/nodejs_api/test/test_data_type.js b/tools/nodejs_api/test/test_data_type.js index 1bb79b73e1..b05cfe17a9 100644 --- a/tools/nodejs_api/test/test_data_type.js +++ b/tools/nodejs_api/test/test_data_type.js @@ -198,9 +198,9 @@ describe("STRUCT", function () { assert.isTrue("o.state" in result[0]); assert.equal(typeof result[0]["o.state"], "object"); assert.deepEqual(result[0]["o.state"], { - REVENUE: 138, - LOCATION: ["'toronto'", " 'montr,eal'"], - STOCK: { PRICE: [96, 56], VOLUME: 1000 }, + revenue: 138, + location: ["'toronto'", " 'montr,eal'"], + stock: { price: [96, 56], volume: 1000 }, }); }); }); diff --git a/tools/python_api/test/test_datatype.py b/tools/python_api/test/test_datatype.py index 7ffaae45ce..18bb267ab1 100644 --- a/tools/python_api/test/test_datatype.py +++ b/tools/python_api/test/test_datatype.py @@ -126,10 +126,10 @@ def test_struct(establish_connection): assert (len(n) == 1) description = n[0] print(description) - assert (description['RATING'] == 1223) - assert (description['VIEWS'] == 10003) - assert (description['RELEASE'] == + assert (description['rating'] == 1223) + assert (description['views'] == 10003) + assert (description['release'] == datetime.datetime(2011, 2, 11, 16, 44, 22)) - assert (description['FILM'] == datetime.date(2013, 2, 22)) + assert (description['film'] == datetime.date(2013, 2, 22)) assert not result.has_next() result.close() diff --git a/tools/python_api/test/test_query_result.py b/tools/python_api/test/test_query_result.py index fa6554ba91..468bd45db6 100644 --- a/tools/python_api/test/test_query_result.py +++ b/tools/python_api/test/test_query_result.py @@ -17,3 +17,10 @@ def test_get_num_tuples(establish_connection): result = conn.execute("MATCH (a:person) WHERE a.ID = 0 RETURN a") assert result.get_num_tuples() == 1 result.close() + + +def test_explain(establish_connection): + conn, db = establish_connection + result = conn.execute("EXPLAIN MATCH (a:person) WHERE a.ID = 0 RETURN a") + assert result.get_num_tuples() == 1 + result.close() diff --git a/tools/python_api/test/test_torch_geometric.py b/tools/python_api/test/test_torch_geometric.py index 6066a39d0b..3eb3ffacc0 100644 --- a/tools/python_api/test/test_torch_geometric.py +++ b/tools/python_api/test/test_torch_geometric.py @@ -230,7 +230,7 @@ def test_to_torch_geometric_heterogeneous_graph(establish_connection): "Property organisation.history of type STRING is not supported by torch_geometric. The property is marked as unconverted.", "Property person.usedNames of type STRING is not supported by torch_geometric. The property is marked as unconverted.", "Property organisation.licenseValidInterval of type INTERVAL is not supported by torch_geometric. The property is marked as unconverted.", - "Property organisation.state of type STRUCT(REVENUE:INT16, LOCATION:STRING is not supported by torch_geometric. The property is marked as unconverted." + "Property organisation.state of type STRUCT(revenue:INT16, location:STRING is not supported by torch_geometric. The property is marked as unconverted." ]) for w in ws: