diff --git a/scripts/export-import-test.py b/scripts/export-import-test.py index 4790cca528c..1f514e9ce94 100644 --- a/scripts/export-import-test.py +++ b/scripts/export-import-test.py @@ -101,6 +101,26 @@ def export_datasets_and_test( # Append `/` so that datasets can be found correctly os.environ["E2E_IMPORT_DB_DIR"] = export_path + os.sep + filter = ( + # These tests fail due to a difference in query id. + # Suspect this to be caused by using import db query instead of + # copying the dataset manually with DDL/DML queries. + "exceptions~copy~duplicated.*:" + "exceptions~copy~ignore_invalid_row.*:" + "exceptions~copy~null_pk.*:" + # This script does not handle tests that use the + # CSV_TO_PARQUET feature of the testing framework. + "copy~copy_pk_long_string_parquet.*:" + # These tests use a dataset that does not define a schema.cypher file. + # There is no import to test against; if we do not filter + # these tests fail on import. + "csv~compressed_csv.*:" + "csv~dialect_detection.*:" + # TODO(Tanvir) We must order node & rel by offset before this test can + # pass. + "function~gds~rec_joins_small.*" + ) + os.environ["GTEST_FILTER"] = f"*:-{filter}" run_command("make test", cwd=test_worktree) return 0 diff --git a/src/processor/operator/simple/export_db.cpp b/src/processor/operator/simple/export_db.cpp index 330eebba050..4ef38a1ac9c 100644 --- a/src/processor/operator/simple/export_db.cpp +++ b/src/processor/operator/simple/export_db.cpp @@ -124,21 +124,51 @@ static void exportLoadedExtensions(stringstream& ss, const ClientContext* client } } +struct EntryAndType { + const CatalogEntry* entry = nullptr; + CatalogEntryType type = CatalogEntryType::DUMMY_ENTRY; +}; + std::string getSchemaCypher(ClientContext* clientContext) { stringstream ss; exportLoadedExtensions(ss, clientContext); const auto catalog = clientContext->getCatalog(); auto transaction = clientContext->getTransaction(); + + auto nodeTableEntries = catalog->getNodeTableEntries(transaction, false); + auto relGroupEntries = catalog->getRelGroupEntries(transaction, false); ToCypherInfo toCypherInfo; - for (const auto& nodeTableEntry : - catalog->getNodeTableEntries(transaction, false /* useInternal */)) { - ss << nodeTableEntry->toCypher(toCypherInfo) << std::endl; - } RelGroupToCypherInfo relTableToCypherInfo{clientContext}; - for (const auto& entry : catalog->getRelGroupEntries(transaction, false /* useInternal */)) { - ss << entry->toCypher(relTableToCypherInfo) << std::endl; - } RelGroupToCypherInfo relGroupToCypherInfo{clientContext}; + + std::vector allEntries; + for (auto* e : nodeTableEntries) { + allEntries.push_back({e->constPtrCast(), CatalogEntryType::NODE_TABLE_ENTRY}); + } + for (auto* e : relGroupEntries) { + allEntries.push_back({e->constPtrCast(), CatalogEntryType::REL_GROUP_ENTRY}); + } + std::sort(allEntries.begin(), allEntries.end(), + [](const EntryAndType& a, const EntryAndType& b) { + return a.entry->getOID() < b.entry->getOID(); + }); + + for (const auto& entryWithType : allEntries) { + switch (entryWithType.type) { + case CatalogEntryType::NODE_TABLE_ENTRY: + ss << entryWithType.entry->constPtrCast()->toCypher(toCypherInfo) + << std::endl; + break; + case CatalogEntryType::REL_GROUP_ENTRY: + ss << entryWithType.entry->constPtrCast()->toCypher( + relTableToCypherInfo) + << std::endl; + break; + default: + KU_UNREACHABLE; + break; + } + } for (const auto sequenceEntry : catalog->getSequenceEntries(transaction)) { ss << sequenceEntry->toCypher(relGroupToCypherInfo) << std::endl; } diff --git a/test/test_files/copy/copy_node_csv.test b/test/test_files/copy/copy_node_csv.test index d06fa6d4d53..1c26ae67c91 100644 --- a/test/test_files/copy/copy_node_csv.test +++ b/test/test_files/copy/copy_node_csv.test @@ -30,9 +30,9 @@ 25002 -LOG CheckSumTest --STATEMENT MATCH (row:tableOfTypes) RETURN sum(row.id), sum(row.int64Column), sum(row.doubleColumn) +-STATEMENT MATCH (row:tableOfTypes) RETURN sum(row.id), sum(row.int64Column), abs(sum(row.doubleColumn) - 2504542.349696) <= 0.0001 ---- 1 -1249925001|2500180|2504542.349696 +1249925001|2500180|True -LOG EmptyStringTest -STATEMENT MATCH (row:tableOfTypes) WHERE row.id = 49992 RETURN row.*; @@ -40,7 +40,7 @@ 49992|50|31.582059|False|1551-07-19|1551-07-19 16:28:31||[5,67,66] -LOG FloatTest --STATEMENT MATCH (row:tableOfTypes) WHERE row.doubleColumn = 68.73718401556897 RETURN row.dateColumn; +-STATEMENT MATCH (row:tableOfTypes) WHERE abs(row.doubleColumn - 68.73718401556897) <= 0.0001 RETURN row.dateColumn; ---- 1 1042-06-05 diff --git a/test/test_files/copy/copy_node_parquet.test b/test/test_files/copy/copy_node_parquet.test index 9fa2ea78d42..c4b10b97b9d 100644 --- a/test/test_files/copy/copy_node_parquet.test +++ b/test/test_files/copy/copy_node_parquet.test @@ -30,9 +30,9 @@ 25002 -LOG CheckSumTest --STATEMENT MATCH (row:tableOfTypes) RETURN sum(row.id), sum(row.int64Column), sum(row.doubleColumn) +-STATEMENT MATCH (row:tableOfTypes) RETURN sum(row.id), sum(row.int64Column), abs(sum(row.doubleColumn) - 2504542.349696) <= 0.0001 ---- 1 -1249925001|2500180|2504542.349696 +1249925001|2500180|True -LOG EmptyStringTest -STATEMENT MATCH (row:tableOfTypes) WHERE row.id = 49992 RETURN row.* @@ -40,7 +40,7 @@ 49992|50|31.582059|False|2056-05-02||[62,24,94]|[LpQO8OT3x45a]|[[268,281,166],[144,16,126,208,298],[22,287]]|{ID: 936, name: sGPSafxMAhKiP} -LOG FloatTest --STATEMENT MATCH (row:tableOfTypes) WHERE row.doubleColumn = 68.73718401556897 RETURN row.dateColumn; +-STATEMENT MATCH (row:tableOfTypes) WHERE abs(row.doubleColumn - 68.73718401556897) <= 0.0001 RETURN row.dateColumn; ---- 1 2055-08-09 diff --git a/test/test_files/copy/export_import_preserve_ids.test b/test/test_files/copy/export_import_preserve_ids.test new file mode 100644 index 00000000000..611a5733f02 --- /dev/null +++ b/test/test_files/copy/export_import_preserve_ids.test @@ -0,0 +1,115 @@ +-DATASET CSV tinysnb + +-- + + +-CASE ExportAndImportPreserveIds +-SKIP_WASM +-SKIP_IN_MEM + +-STATEMENT MATCH (n) RETURN id(n), n +---- 14 +0:0|{_ID: 0:0, _LABEL: person, ID: 0, fName: Alice, gender: 1, isStudent: True, isWorker: False, age: 35, eyeSight: 5.000000, birthdate: 1900-01-01, registerTime: 2011-08-20 11:25:30, lastJobDuration: 3 years 2 days 13:02:00, workedHours: [10,5], usedNames: [Aida], courseScoresPerTerm: [[10,8],[6,7,8]], grades: [96,54,86,92], height: 1.731000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11} +0:1|{_ID: 0:1, _LABEL: person, ID: 2, fName: Bob, gender: 2, isStudent: True, isWorker: False, age: 30, eyeSight: 5.100000, birthdate: 1900-01-01, registerTime: 2008-11-03 15:25:30.000526, lastJobDuration: 10 years 5 months 13:00:00.000024, workedHours: [12,8], usedNames: [Bobby], courseScoresPerTerm: [[8,9],[9,10]], grades: [98,42,93,88], height: 0.990000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12} +0:2|{_ID: 0:2, _LABEL: person, ID: 3, fName: Carol, gender: 1, isStudent: False, isWorker: True, age: 45, eyeSight: 5.000000, birthdate: 1940-06-22, registerTime: 1911-08-20 02:32:21, lastJobDuration: 48:24:11, workedHours: [4,5], usedNames: [Carmen,Fred], courseScoresPerTerm: [[8,10]], grades: [91,75,21,95], height: 1.000000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a13} +0:3|{_ID: 0:3, _LABEL: person, ID: 5, fName: Dan, gender: 2, isStudent: False, isWorker: True, age: 20, eyeSight: 4.800000, birthdate: 1950-07-23, registerTime: 2031-11-30 12:25:30, lastJobDuration: 10 years 5 months 13:00:00.000024, workedHours: [1,9], usedNames: [Wolfeschlegelstein,Daniel], courseScoresPerTerm: [[7,4],[8,8],[9]], grades: [76,88,99,89], height: 1.300000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14} +0:4|{_ID: 0:4, _LABEL: person, ID: 7, fName: Elizabeth, gender: 1, isStudent: False, isWorker: True, age: 20, eyeSight: 4.700000, birthdate: 1980-10-26, registerTime: 1976-12-23 11:21:42, lastJobDuration: 48:24:11, workedHours: [2], usedNames: [Ein], courseScoresPerTerm: [[6],[7],[8]], grades: [96,59,65,88], height: 1.463000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a15} +0:5|{_ID: 0:5, _LABEL: person, ID: 8, fName: Farooq, gender: 2, isStudent: True, isWorker: False, age: 25, eyeSight: 4.500000, birthdate: 1980-10-26, registerTime: 1972-07-31 13:22:30.678559, lastJobDuration: 00:18:00.024, workedHours: [3,4,5,6,7], usedNames: [Fesdwe], courseScoresPerTerm: [[8]], grades: [80,78,34,83], height: 1.510000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a16} +0:6|{_ID: 0:6, _LABEL: person, ID: 9, fName: Greg, gender: 2, isStudent: False, isWorker: False, age: 40, eyeSight: 4.900000, birthdate: 1980-10-26, registerTime: 1976-12-23 04:41:42, lastJobDuration: 10 years 5 months 13:00:00.000024, workedHours: [1], usedNames: [Grad], courseScoresPerTerm: [[10]], grades: [43,83,67,43], height: 1.600000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17} +0:7|{_ID: 0:7, _LABEL: person, ID: 10, fName: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff, gender: 2, isStudent: False, isWorker: True, age: 83, eyeSight: 4.900000, birthdate: 1990-11-27, registerTime: 2023-02-21 13:25:30, lastJobDuration: 3 years 2 days 13:02:00, workedHours: [10,11,12,3,4,5,6,7], usedNames: [Ad,De,Hi,Kye,Orlan], courseScoresPerTerm: [[7],[10],[6,7]], grades: [77,64,100,54], height: 1.323000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a18} +1:0|{_ID: 1:0, _LABEL: organisation, 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}}, info: 3.120000} +1:1|{_ID: 1:1, _LABEL: organisation, 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}}, info: abcd} +1:2|{_ID: 1:2, _LABEL: organisation, 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}}, info: 2023-12-15} +2:0|{_ID: 2:0, _LABEL: movies, name: Sóló cón tu párejâ, length: 126, note: this is a very very good movie, description: {rating: 5.300000, stars: 2, views: 152, release: 2011-08-20 11:25:30, release_ns: 2011-08-20 11:25:30.123456, release_ms: 2011-08-20 11:25:30.123, release_sec: 2011-08-20 11:25:30, release_tz: 2011-08-20 11:25:30.123456+00, film: 2012-05-11, u8: 220, u16: 20, u32: 1, u64: 180, hugedata: 1844674407370955161811111111}, content: \xAA\xABinteresting\x0B, audience: {audience1=52, audience53=42}, grade: True} +2:1|{_ID: 2:1, _LABEL: movies, name: The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length: 2544, note: the movie is very very good, description: {rating: 7.000000, stars: 10, views: 982, release: 2018-11-13 13:33:11, release_ns: 2018-11-13 13:33:11.123456, release_ms: 2018-11-13 13:33:11.123, release_sec: 2018-11-13 13:33:11, release_tz: 2018-11-13 13:33:11.123456+00, film: 2014-09-12, u8: 12, u16: 120, u32: 55, u64: 1, hugedata: -1844674407370955161511}, content: \xAB\xCD, audience: {audience1=33}, grade: 8.989000} +2:2|{_ID: 2:2, _LABEL: movies, name: Roma, length: 298, note: the movie is very interesting and funny, description: {rating: 1223.000000, stars: 100, views: 10003, release: 2011-02-11 16:44:22, release_ns: 2011-02-11 16:44:22.123456, release_ms: 2011-02-11 16:44:22.123, release_sec: 2011-02-11 16:44:22, release_tz: 2011-02-11 16:44:22.123456+00, film: 2013-02-22, u8: 1, u16: 15, u32: 200, u64: 4, hugedata: -15}, content: pure ascii characters, audience: {}, grade: 254.000000} + +-STATEMENT MATCH ()-[r]->() RETURN id(r), r +---- 30 +11:0|(0:0)-{_LABEL: marries, _ID: 11:0, usedAddress: [toronto], address: [4,5]}->(0:1) +11:1|(0:2)-{_LABEL: marries, _ID: 11:1, address: [2,5], note: long long long string}->(0:3) +11:2|(0:4)-{_LABEL: marries, _ID: 11:2, usedAddress: [], address: [3,9], note: short str}->(0:5) +3:0|(0:0)-{_LABEL: knows, _ID: 3:0, date: 2021-06-30, meetTime: 1986-10-21 21:08:31.521, validInterval: 10 years 5 months 13:00:00.000024, comments: [rnme,m8sihsdnf2990nfiwf], summary: {locations: ['toronto','waterloo'], transfer: {day: 2021-01-02, amount: [100,200]}}, notes: 1, someMap: {a=b}}->(0:1) +3:10|(0:3)-{_LABEL: knows, _ID: 3:10, date: 1950-05-14, meetTime: 1982-11-11 13:12:05.123, validInterval: 00:23:00, comments: [fewh9182912e3,h9y8y89soidfsf,nuhudf78w78efw,hioshe0f9023sdsd], summary: {locations: ['paris'], transfer: {day: 2000-01-01, amount: [20,5000]}}, notes: happy new year}->(0:1) +3:11|(0:3)-{_LABEL: knows, _ID: 3:11, date: 2000-01-01, meetTime: 1999-04-21 15:12:11.42, validInterval: 48:00:00.052, comments: [23h9sdslnfowhu2932,shuhf98922323sf], summary: {locations: ['paris'], transfer: {day: 2000-01-01, amount: [20,5000]}}, notes: 4}->(0:2) +3:12|(0:4)-{_LABEL: knows, _ID: 3:12, date: 1905-12-12, meetTime: 2025-01-01 11:22:33.52, validInterval: 00:47:58, comments: [ahu2333333333333,12weeeeeeeeeeeeeeeeee], summary: {locations: ['toronto','thisisalongcityname'], transfer: {day: 1930-11-22, amount: [18,323]}}, notes: 8}->(0:5) +3:13|(0:4)-{_LABEL: knows, _ID: 3:13, date: 1905-12-12, meetTime: 2020-03-01 12:11:41.6552, validInterval: 00:47:58, comments: [peweeeeeeeeeeeeeeeee,kowje9w0eweeeeeeeee], summary: {locations: ['waterloo'], transfer: {day: 2000-01-01, amount: [1000,5000]}}, notes: 10}->(0:6) +3:1|(0:0)-{_LABEL: knows, _ID: 3:1, date: 2021-06-30, meetTime: 1946-08-25 19:07:22, validInterval: 20 years 30 days 48:00:00, comments: [njnojppo9u0jkmf,fjiojioh9h9h89hph], summary: {locations: , transfer: }, notes: 2020-10-10, someMap: {c=d, e=f, 1=2}}->(0:2) +3:2|(0:0)-{_LABEL: knows, _ID: 3:2, date: 2021-06-30, meetTime: 2012-12-11 20:07:22, validInterval: 10 days, comments: [ioji232,jifhe8w99u43434], summary: {locations: ['shanghai'], transfer: {day: 1990-09-10, amount: [10]}}, notes: nice weather}->(0:3) +3:3|(0:1)-{_LABEL: knows, _ID: 3:3, date: 2021-06-30, meetTime: 1946-08-25 19:07:22, validInterval: 10 years 5 months 13:00:00.000024, comments: [2huh9y89fsfw23,23nsihufhw723], summary: {locations: ['paris'], transfer: {day: 2000-01-01, amount: [20,5000]}}, notes: 4}->(0:0) +3:4|(0:1)-{_LABEL: knows, _ID: 3:4, date: 1950-05-14, meetTime: 1946-08-25 19:07:22, validInterval: 00:23:00, comments: [fwehu9h9832wewew,23u9h989sdfsss], summary: {locations: ['paris'], transfer: {day: 2011-05-01, amount: [2000,5340]}}, notes: cool stuff found}->(0:2) +3:5|(0:1)-{_LABEL: knows, _ID: 3:5, date: 1950-05-14, meetTime: 2012-12-11 20:07:22, validInterval: 20 years 30 days 48:00:00, comments: [fwh9y81232uisuiehuf,ewnuihxy8dyf232], summary: {locations: ['vancouver'], transfer: {day: 2020-01-01, amount: [120,50]}}, notes: matthew perry}->(0:3) +3:6|(0:2)-{_LABEL: knows, _ID: 3:6, date: 2021-06-30, meetTime: 2002-07-31 11:42:53.12342, validInterval: 40 days 30:00:00, comments: [fnioh8323aeweae34d,osd89e2ejshuih12], summary: {locations: ['london','toronto'], transfer: {day: 2012-11-21, amount: [223,5230]}}, notes: 10}->(0:0) +3:7|(0:2)-{_LABEL: knows, _ID: 3:7, date: 1950-05-14, meetTime: 2007-02-12 12:11:42.123, validInterval: 00:28:00.03, comments: [fwh983-sdjisdfji,ioh89y32r2huir], summary: {locations: ['paris','beijing'], transfer: {day: 2011-03-11, amount: [2323,50]}}, notes: 1}->(0:1) +3:8|(0:2)-{_LABEL: knows, _ID: 3:8, date: 2000-01-01, meetTime: 1998-10-02 13:09:22.423, validInterval: 00:00:00.3, comments: [psh989823oaaioe,nuiuah1nosndfisf], summary: {locations: [], transfer: {day: 1980-11-21, amount: [20,5]}}, notes: 2}->(0:3) +3:9|(0:3)-{_LABEL: knows, _ID: 3:9, date: 2021-06-30, meetTime: 1936-11-02 11:02:01, validInterval: 00:00:00.00048, comments: [fwewe], summary: {locations: ['shanghai','nanjing'], transfer: {day: 1998-11-12, amount: [22,53240]}}, notes: 15}->(0:0) +5:0|(0:0)-{_LABEL: studyAt, _ID: 5:0, year: 2021, places: [wwAewsdndweusd,wek], length: 5, level: 5, code: 9223372036854775808, temperature: 32800, ulength: 33768, ulevel: 250, hugedata: 1844674407370955161811111111}->(1:0) +5:1|(0:1)-{_LABEL: studyAt, _ID: 5:1, year: 2020, places: [anew,jsdnwusklklklwewsd], length: 55, level: 120, code: 6689, temperature: 1, ulength: 90, ulevel: 220, hugedata: -1844674407370955161511}->(1:0) +5:2|(0:5)-{_LABEL: studyAt, _ID: 5:2, year: 2020, places: [awndsnjwejwen,isuhuwennjnuhuhuwewe], length: 22, level: 2, code: 23, temperature: 20, ulength: 180, ulevel: 12, hugedata: -15}->(1:0) +7:0|(0:2)-{_LABEL: workAt, _ID: 7:0, year: 2015, grading: [3.800000,2.500000], rating: 8.200000}->(1:1) +7:1|(0:3)-{_LABEL: workAt, _ID: 7:1, year: 2010, grading: [2.100000,4.400000], rating: 7.600000}->(1:2) +7:2|(0:4)-{_LABEL: workAt, _ID: 7:2, year: 2015, grading: [9.200000,3.100000], rating: 9.200000}->(1:2) +9:0|(0:0)-{_LABEL: meets, _ID: 9:0, location: [7.820000,3.540000], times: 5, data: \xAA\xBB\xCC\xDD}->(0:1) +9:1|(0:1)-{_LABEL: meets, _ID: 9:1, location: [2.870000,4.230000], times: 2, data: NO hex code}->(0:3) +9:2|(0:2)-{_LABEL: meets, _ID: 9:2, location: [3.650000,8.440000], times: 3, data: MIXED \xAC with ASCII \x0A}->(0:4) +9:3|(0:4)-{_LABEL: meets, _ID: 9:3, location: [2.110000,3.100000], times: 7, data: \xA1*}->(0:2) +9:4|(0:5)-{_LABEL: meets, _ID: 9:4, location: [2.200000,9.000000], times: 9, data: :\xA3}->(0:2) +9:5|(0:6)-{_LABEL: meets, _ID: 9:5, location: [3.000000,5.200000], times: 11, data: NO hex code}->(0:2) +9:6|(0:7)-{_LABEL: meets, _ID: 9:6, location: [3.500000,1.100000], times: 13, data: :\xA3}->(0:1) + +-STATEMENT EXPORT DATABASE "${KUZU_EXPORT_DB_DIRECTORY}_special/preserve_ids" (format='csv', header=true); +---- ok +-IMPORT_DATABASE "${KUZU_EXPORT_DB_DIRECTORY}_special/preserve_ids" +-STATEMENT IMPORT DATABASE "${KUZU_EXPORT_DB_DIRECTORY}_special/preserve_ids"; +---- ok + +-STATEMENT MATCH (n) RETURN id(n), n +---- 14 +0:0|{_ID: 0:0, _LABEL: person, ID: 0, fName: Alice, gender: 1, isStudent: True, isWorker: False, age: 35, eyeSight: 5.000000, birthdate: 1900-01-01, registerTime: 2011-08-20 11:25:30, lastJobDuration: 3 years 2 days 13:02:00, workedHours: [10,5], usedNames: [Aida], courseScoresPerTerm: [[10,8],[6,7,8]], grades: [96,54,86,92], height: 1.731000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11} +0:1|{_ID: 0:1, _LABEL: person, ID: 2, fName: Bob, gender: 2, isStudent: True, isWorker: False, age: 30, eyeSight: 5.100000, birthdate: 1900-01-01, registerTime: 2008-11-03 15:25:30.000526, lastJobDuration: 10 years 5 months 13:00:00.000024, workedHours: [12,8], usedNames: [Bobby], courseScoresPerTerm: [[8,9],[9,10]], grades: [98,42,93,88], height: 0.990000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12} +0:2|{_ID: 0:2, _LABEL: person, ID: 3, fName: Carol, gender: 1, isStudent: False, isWorker: True, age: 45, eyeSight: 5.000000, birthdate: 1940-06-22, registerTime: 1911-08-20 02:32:21, lastJobDuration: 48:24:11, workedHours: [4,5], usedNames: [Carmen,Fred], courseScoresPerTerm: [[8,10]], grades: [91,75,21,95], height: 1.000000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a13} +0:3|{_ID: 0:3, _LABEL: person, ID: 5, fName: Dan, gender: 2, isStudent: False, isWorker: True, age: 20, eyeSight: 4.800000, birthdate: 1950-07-23, registerTime: 2031-11-30 12:25:30, lastJobDuration: 10 years 5 months 13:00:00.000024, workedHours: [1,9], usedNames: [Wolfeschlegelstein,Daniel], courseScoresPerTerm: [[7,4],[8,8],[9]], grades: [76,88,99,89], height: 1.300000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14} +0:4|{_ID: 0:4, _LABEL: person, ID: 7, fName: Elizabeth, gender: 1, isStudent: False, isWorker: True, age: 20, eyeSight: 4.700000, birthdate: 1980-10-26, registerTime: 1976-12-23 11:21:42, lastJobDuration: 48:24:11, workedHours: [2], usedNames: [Ein], courseScoresPerTerm: [[6],[7],[8]], grades: [96,59,65,88], height: 1.463000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a15} +0:5|{_ID: 0:5, _LABEL: person, ID: 8, fName: Farooq, gender: 2, isStudent: True, isWorker: False, age: 25, eyeSight: 4.500000, birthdate: 1980-10-26, registerTime: 1972-07-31 13:22:30.678559, lastJobDuration: 00:18:00.024, workedHours: [3,4,5,6,7], usedNames: [Fesdwe], courseScoresPerTerm: [[8]], grades: [80,78,34,83], height: 1.510000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a16} +0:6|{_ID: 0:6, _LABEL: person, ID: 9, fName: Greg, gender: 2, isStudent: False, isWorker: False, age: 40, eyeSight: 4.900000, birthdate: 1980-10-26, registerTime: 1976-12-23 04:41:42, lastJobDuration: 10 years 5 months 13:00:00.000024, workedHours: [1], usedNames: [Grad], courseScoresPerTerm: [[10]], grades: [43,83,67,43], height: 1.600000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17} +0:7|{_ID: 0:7, _LABEL: person, ID: 10, fName: Hubert Blaine Wolfeschlegelsteinhausenbergerdorff, gender: 2, isStudent: False, isWorker: True, age: 83, eyeSight: 4.900000, birthdate: 1990-11-27, registerTime: 2023-02-21 13:25:30, lastJobDuration: 3 years 2 days 13:02:00, workedHours: [10,11,12,3,4,5,6,7], usedNames: [Ad,De,Hi,Kye,Orlan], courseScoresPerTerm: [[7],[10],[6,7]], grades: [77,64,100,54], height: 1.323000, u: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a18} +1:0|{_ID: 1:0, _LABEL: organisation, 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}}, info: 3.120000} +1:1|{_ID: 1:1, _LABEL: organisation, 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}}, info: abcd} +1:2|{_ID: 1:2, _LABEL: organisation, 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}}, info: 2023-12-15} +2:0|{_ID: 2:0, _LABEL: movies, name: Sóló cón tu párejâ, length: 126, note: this is a very very good movie, description: {rating: 5.300000, stars: 2, views: 152, release: 2011-08-20 11:25:30, release_ns: 2011-08-20 11:25:30.123456, release_ms: 2011-08-20 11:25:30.123, release_sec: 2011-08-20 11:25:30, release_tz: 2011-08-20 11:25:30.123456+00, film: 2012-05-11, u8: 220, u16: 20, u32: 1, u64: 180, hugedata: 1844674407370955161811111111}, content: \xAA\xABinteresting\x0B, audience: {audience1=52, audience53=42}, grade: True} +2:1|{_ID: 2:1, _LABEL: movies, name: The 😂😃🧘🏻‍♂️🌍🌦️🍞🚗 movie, length: 2544, note: the movie is very very good, description: {rating: 7.000000, stars: 10, views: 982, release: 2018-11-13 13:33:11, release_ns: 2018-11-13 13:33:11.123456, release_ms: 2018-11-13 13:33:11.123, release_sec: 2018-11-13 13:33:11, release_tz: 2018-11-13 13:33:11.123456+00, film: 2014-09-12, u8: 12, u16: 120, u32: 55, u64: 1, hugedata: -1844674407370955161511}, content: \xAB\xCD, audience: {audience1=33}, grade: 8.989000} +2:2|{_ID: 2:2, _LABEL: movies, name: Roma, length: 298, note: the movie is very interesting and funny, description: {rating: 1223.000000, stars: 100, views: 10003, release: 2011-02-11 16:44:22, release_ns: 2011-02-11 16:44:22.123456, release_ms: 2011-02-11 16:44:22.123, release_sec: 2011-02-11 16:44:22, release_tz: 2011-02-11 16:44:22.123456+00, film: 2013-02-22, u8: 1, u16: 15, u32: 200, u64: 4, hugedata: -15}, content: pure ascii characters, audience: {}, grade: 254.000000} + +-STATEMENT MATCH ()-[r]->() RETURN id(r), r +---- 30 +11:0|(0:0)-{_LABEL: marries, _ID: 11:0, usedAddress: [toronto], address: [4,5]}->(0:1) +11:1|(0:2)-{_LABEL: marries, _ID: 11:1, address: [2,5], note: long long long string}->(0:3) +11:2|(0:4)-{_LABEL: marries, _ID: 11:2, usedAddress: [], address: [3,9], note: short str}->(0:5) +3:0|(0:0)-{_LABEL: knows, _ID: 3:0, date: 2021-06-30, meetTime: 1986-10-21 21:08:31.521, validInterval: 10 years 5 months 13:00:00.000024, comments: [rnme,m8sihsdnf2990nfiwf], summary: {locations: ['toronto','waterloo'], transfer: {day: 2021-01-02, amount: [100,200]}}, notes: 1, someMap: {a=b}}->(0:1) +3:10|(0:3)-{_LABEL: knows, _ID: 3:10, date: 1950-05-14, meetTime: 1982-11-11 13:12:05.123, validInterval: 00:23:00, comments: [fewh9182912e3,h9y8y89soidfsf,nuhudf78w78efw,hioshe0f9023sdsd], summary: {locations: ['paris'], transfer: {day: 2000-01-01, amount: [20,5000]}}, notes: happy new year}->(0:1) +3:11|(0:3)-{_LABEL: knows, _ID: 3:11, date: 2000-01-01, meetTime: 1999-04-21 15:12:11.42, validInterval: 48:00:00.052, comments: [23h9sdslnfowhu2932,shuhf98922323sf], summary: {locations: ['paris'], transfer: {day: 2000-01-01, amount: [20,5000]}}, notes: 4}->(0:2) +3:12|(0:4)-{_LABEL: knows, _ID: 3:12, date: 1905-12-12, meetTime: 2025-01-01 11:22:33.52, validInterval: 00:47:58, comments: [ahu2333333333333,12weeeeeeeeeeeeeeeeee], summary: {locations: ['toronto','thisisalongcityname'], transfer: {day: 1930-11-22, amount: [18,323]}}, notes: 8}->(0:5) +3:13|(0:4)-{_LABEL: knows, _ID: 3:13, date: 1905-12-12, meetTime: 2020-03-01 12:11:41.6552, validInterval: 00:47:58, comments: [peweeeeeeeeeeeeeeeee,kowje9w0eweeeeeeeee], summary: {locations: ['waterloo'], transfer: {day: 2000-01-01, amount: [1000,5000]}}, notes: 10}->(0:6) +3:1|(0:0)-{_LABEL: knows, _ID: 3:1, date: 2021-06-30, meetTime: 1946-08-25 19:07:22, validInterval: 20 years 30 days 48:00:00, comments: [njnojppo9u0jkmf,fjiojioh9h9h89hph], summary: {locations: , transfer: }, notes: 2020-10-10, someMap: {c=d, e=f, 1=2}}->(0:2) +3:2|(0:0)-{_LABEL: knows, _ID: 3:2, date: 2021-06-30, meetTime: 2012-12-11 20:07:22, validInterval: 10 days, comments: [ioji232,jifhe8w99u43434], summary: {locations: ['shanghai'], transfer: {day: 1990-09-10, amount: [10]}}, notes: nice weather}->(0:3) +3:3|(0:1)-{_LABEL: knows, _ID: 3:3, date: 2021-06-30, meetTime: 1946-08-25 19:07:22, validInterval: 10 years 5 months 13:00:00.000024, comments: [2huh9y89fsfw23,23nsihufhw723], summary: {locations: ['paris'], transfer: {day: 2000-01-01, amount: [20,5000]}}, notes: 4}->(0:0) +3:4|(0:1)-{_LABEL: knows, _ID: 3:4, date: 1950-05-14, meetTime: 1946-08-25 19:07:22, validInterval: 00:23:00, comments: [fwehu9h9832wewew,23u9h989sdfsss], summary: {locations: ['paris'], transfer: {day: 2011-05-01, amount: [2000,5340]}}, notes: cool stuff found}->(0:2) +3:5|(0:1)-{_LABEL: knows, _ID: 3:5, date: 1950-05-14, meetTime: 2012-12-11 20:07:22, validInterval: 20 years 30 days 48:00:00, comments: [fwh9y81232uisuiehuf,ewnuihxy8dyf232], summary: {locations: ['vancouver'], transfer: {day: 2020-01-01, amount: [120,50]}}, notes: matthew perry}->(0:3) +3:6|(0:2)-{_LABEL: knows, _ID: 3:6, date: 2021-06-30, meetTime: 2002-07-31 11:42:53.12342, validInterval: 40 days 30:00:00, comments: [fnioh8323aeweae34d,osd89e2ejshuih12], summary: {locations: ['london','toronto'], transfer: {day: 2012-11-21, amount: [223,5230]}}, notes: 10}->(0:0) +3:7|(0:2)-{_LABEL: knows, _ID: 3:7, date: 1950-05-14, meetTime: 2007-02-12 12:11:42.123, validInterval: 00:28:00.03, comments: [fwh983-sdjisdfji,ioh89y32r2huir], summary: {locations: ['paris','beijing'], transfer: {day: 2011-03-11, amount: [2323,50]}}, notes: 1}->(0:1) +3:8|(0:2)-{_LABEL: knows, _ID: 3:8, date: 2000-01-01, meetTime: 1998-10-02 13:09:22.423, validInterval: 00:00:00.3, comments: [psh989823oaaioe,nuiuah1nosndfisf], summary: {locations: [], transfer: {day: 1980-11-21, amount: [20,5]}}, notes: 2}->(0:3) +3:9|(0:3)-{_LABEL: knows, _ID: 3:9, date: 2021-06-30, meetTime: 1936-11-02 11:02:01, validInterval: 00:00:00.00048, comments: [fwewe], summary: {locations: ['shanghai','nanjing'], transfer: {day: 1998-11-12, amount: [22,53240]}}, notes: 15}->(0:0) +5:0|(0:0)-{_LABEL: studyAt, _ID: 5:0, year: 2021, places: [wwAewsdndweusd,wek], length: 5, level: 5, code: 9223372036854775808, temperature: 32800, ulength: 33768, ulevel: 250, hugedata: 1844674407370955161811111111}->(1:0) +5:1|(0:1)-{_LABEL: studyAt, _ID: 5:1, year: 2020, places: [anew,jsdnwusklklklwewsd], length: 55, level: 120, code: 6689, temperature: 1, ulength: 90, ulevel: 220, hugedata: -1844674407370955161511}->(1:0) +5:2|(0:5)-{_LABEL: studyAt, _ID: 5:2, year: 2020, places: [awndsnjwejwen,isuhuwennjnuhuhuwewe], length: 22, level: 2, code: 23, temperature: 20, ulength: 180, ulevel: 12, hugedata: -15}->(1:0) +7:0|(0:2)-{_LABEL: workAt, _ID: 7:0, year: 2015, grading: [3.800000,2.500000], rating: 8.200000}->(1:1) +7:1|(0:3)-{_LABEL: workAt, _ID: 7:1, year: 2010, grading: [2.100000,4.400000], rating: 7.600000}->(1:2) +7:2|(0:4)-{_LABEL: workAt, _ID: 7:2, year: 2015, grading: [9.200000,3.100000], rating: 9.200000}->(1:2) +9:0|(0:0)-{_LABEL: meets, _ID: 9:0, location: [7.820000,3.540000], times: 5, data: \xAA\xBB\xCC\xDD}->(0:1) +9:1|(0:1)-{_LABEL: meets, _ID: 9:1, location: [2.870000,4.230000], times: 2, data: NO hex code}->(0:3) +9:2|(0:2)-{_LABEL: meets, _ID: 9:2, location: [3.650000,8.440000], times: 3, data: MIXED \xAC with ASCII \x0A}->(0:4) +9:3|(0:4)-{_LABEL: meets, _ID: 9:3, location: [2.110000,3.100000], times: 7, data: \xA1*}->(0:2) +9:4|(0:5)-{_LABEL: meets, _ID: 9:4, location: [2.200000,9.000000], times: 9, data: :\xA3}->(0:2) +9:5|(0:6)-{_LABEL: meets, _ID: 9:5, location: [3.000000,5.200000], times: 11, data: NO hex code}->(0:2) +9:6|(0:7)-{_LABEL: meets, _ID: 9:6, location: [3.500000,1.100000], times: 13, data: :\xA3}->(0:1) + diff --git a/test/test_files/nested_types/large_array.test b/test/test_files/nested_types/large_array.test index 8fde0568ef7..ee5005cd84e 100644 --- a/test/test_files/nested_types/large_array.test +++ b/test/test_files/nested_types/large_array.test @@ -5,6 +5,6 @@ -STATEMENT MATCH (u:person) RETURN u.ID, u.embedding ORDER BY u.ID DESC LIMIT 1; ---- 1 9998|[0.123655,0.781263,0.001109,0.249284,0.469616,0.945860,0.364329,0.788855,0.009410,0.149256,0.592328,0.168283,0.063145,0.304603,0.195098,0.967029,0.716229,0.631408,0.576478,0.483858,0.614311,0.440887,0.394348,0.135743,0.597661,0.358071,0.024519,0.374152,0.557506,0.876006,0.612007,0.130599,0.679080,0.678651,0.673458,0.133532,0.505031,0.220965,0.026113,0.571795,0.426235,0.550285,0.047089,0.474228,0.841275,0.302041,0.482254,0.606756,0.812161,0.999015,0.907731,0.321990,0.148814,0.713319,0.244760,0.185409,0.826248,0.931503,0.486253,0.265485,0.430017,0.274838,0.403234,0.854725,0.868718,0.319589,0.739281,0.207641,0.072567,0.103014,0.314223,0.819861,0.099357,0.909448,0.228721,0.863032,0.625120,0.871700,0.149276,0.252710,0.186461,0.252335,0.349150,0.661578,0.054636,0.575431,0.793400,0.437550,0.991869,0.899740,0.933181,0.002855,0.587611,0.757471,0.455644,0.998326,0.511699,0.033962,0.255552,0.442520,0.703907,0.801576,0.454502,0.452512,0.615673,0.014512,0.361325,0.021650,0.021152,0.121675,0.783833,0.381653,0.290483,0.724366,0.714949,0.062113,0.818325,0.780339,0.541165,0.040977,0.189235,0.436049,0.815548,0.407596,0.904772,0.470955,0.085176,0.319802,0.639783,0.088433,0.341368,0.724548,0.412345,0.762805,0.891829,0.489405,0.563964,0.846203,0.548890,0.800415,0.143956,0.161062,0.709006,0.327651,0.479494,0.415464,0.418741,0.052670,0.925006,0.516234,0.932992,0.970318,0.633118,0.195480,0.702994,0.134372,0.078851,0.456076,0.859394,0.021032,0.807008,0.155791,0.557705,0.064758,0.455909,0.087403,0.475801] --STATEMENT MATCH (u:person) RETURN SUM(list_sum(u.embedding)); +-STATEMENT MATCH (u:person) RETURN abs(SUM(list_sum(u.embedding))-783313.291344) <= 0.001; ---- 1 -783313.291344 +True