Skip to content

Commit 18f7933

Browse files
author
Can Gokmen
committed
Finished bulk load implementation
1 parent e186833 commit 18f7933

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎ART.h‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,18 @@ class ART {
342342
bl_pf_bytes[2] = b2;
343343

344344
//this->printTree();
345-
346345
}
347346

348-
//this->printTree();
347+
// Handle remaining keys, insert them using the standard insert method
348+
size_t start_idx = num_complete_groups * 256;
349+
for (size_t i = 0; i < remaining_keys; i++) {
350+
uint8_t key_bytes[4];
351+
key_bytes[0] = (keys[start_idx + i] >> 24) & 0xFF;
352+
key_bytes[1] = (keys[start_idx + i] >> 16) & 0xFF;
353+
key_bytes[2] = (keys[start_idx + i] >> 8) & 0xFF;
354+
key_bytes[3] = keys[start_idx + i] & 0xFF;
355+
insert(this, root, &root, key_bytes, 0, values[start_idx + i], maxPrefixLength);
356+
}
349357
return;
350358
}
351359

0 commit comments

Comments
 (0)