Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
60861ae
experiment
tgahunia05 Jul 15, 2025
18485fc
experimental
tgahunia05 Jul 15, 2025
8b3cd11
experiment
tgahunia05 Jul 15, 2025
28c5433
experiment
tgahunia05 Jul 15, 2025
c7b7c7c
Fix
tgahunia05 Jul 15, 2025
e7bb11e
implement sort_internal_ids
tgahunia05 Jul 15, 2025
5fb74db
fix
tgahunia05 Jul 15, 2025
4be5ce5
update
tgahunia05 Jul 15, 2025
c0628ae
clean
tgahunia05 Jul 15, 2025
0ef1aed
clean
tgahunia05 Jul 15, 2025
e39b5a1
ci: auto code format
tgahunia05 Jul 15, 2025
a9f44ed
add test
tgahunia05 Jul 15, 2025
be2aded
Clean
tgahunia05 Jul 15, 2025
c5d372b
clean
tgahunia05 Jul 15, 2025
87275b2
ci: auto code format
tgahunia05 Jul 15, 2025
5dbfe61
try
tgahunia05 Jul 15, 2025
44c255a
revert csv and remove do not preserve id test
tgahunia05 Jul 15, 2025
f274a49
PR feedback
tgahunia05 Jul 16, 2025
1a54fd4
Pr feedback
tgahunia05 Jul 16, 2025
c230c55
PR feedback
tgahunia05 Jul 16, 2025
69dd24c
pr feedback
tgahunia05 Jul 16, 2025
ebe0744
ci: auto code format
tgahunia05 Jul 16, 2025
ef75c7d
pr feedback
tgahunia05 Jul 16, 2025
3f2c2ce
ci: auto code format
tgahunia05 Jul 16, 2025
f817ff7
fix test
tgahunia05 Jul 16, 2025
f0720d6
wip
tgahunia05 Jul 21, 2025
5fb9858
retry CI
tgahunia05 Jul 22, 2025
d389689
retry ci
tgahunia05 Jul 23, 2025
bf19d9d
clean
tgahunia05 Jul 28, 2025
e3ad130
clean
tgahunia05 Jul 28, 2025
6112ed4
try fix
tgahunia05 Jul 28, 2025
00e1f53
fix test
tgahunia05 Jul 28, 2025
3531ca1
add filter
tgahunia05 Jul 28, 2025
0f8014e
filter another test
tgahunia05 Jul 28, 2025
acaf921
comment on failing tests
tgahunia05 Jul 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions scripts/export-import-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
)
Comment thread
tgahunia05 marked this conversation as resolved.
os.environ["GTEST_FILTER"] = f"*:-{filter}"
run_command("make test", cwd=test_worktree)
return 0

Expand Down
44 changes: 37 additions & 7 deletions src/processor/operator/simple/export_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<EntryAndType> allEntries;
for (auto* e : nodeTableEntries) {
allEntries.push_back({e->constPtrCast<CatalogEntry>(), CatalogEntryType::NODE_TABLE_ENTRY});
}
for (auto* e : relGroupEntries) {
allEntries.push_back({e->constPtrCast<CatalogEntry>(), 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<NodeTableCatalogEntry>()->toCypher(toCypherInfo)
<< std::endl;
break;
case CatalogEntryType::REL_GROUP_ENTRY:
ss << entryWithType.entry->constPtrCast<RelGroupCatalogEntry>()->toCypher(
relTableToCypherInfo)
<< std::endl;
break;
default:
KU_UNREACHABLE;
break;
}
}
for (const auto sequenceEntry : catalog->getSequenceEntries(transaction)) {
ss << sequenceEntry->toCypher(relGroupToCypherInfo) << std::endl;
}
Expand Down
6 changes: 3 additions & 3 deletions test/test_files/copy/copy_node_csv.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
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.*;
---- 1
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

Expand Down
6 changes: 3 additions & 3 deletions test/test_files/copy/copy_node_parquet.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
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.*
---- 1
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

Expand Down
Loading
Loading