MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / build

Method build

nodedb/src/engine/timeseries/skip_index.rs:128–142  ·  view source on GitHub ↗

Build from a column of u32 symbol IDs.

(column_name: &str, values: &[u32], block_size: usize)

Source from the content-addressed store, hash-verified

126impl SetIndex {
127 /// Build from a column of u32 symbol IDs.
128 pub fn build(column_name: &str, values: &[u32], block_size: usize) -> Self {
129 let blocks = values
130 .chunks(block_size)
131 .map(|chunk| {
132 let mut unique: Vec<u32> = chunk.to_vec();
133 unique.sort_unstable();
134 unique.dedup();
135 unique
136 })
137 .collect();
138 Self {
139 column_name: column_name.to_string(),
140 blocks,
141 }
142 }
143
144 /// Return block indices that contain the given symbol ID.
145 pub fn filter_eq(&self, symbol_id: u32) -> Vec<usize> {

Callers 15

build_storeFunction · 0.45
newMethod · 0.45
make_schemaFunction · 0.45
make_ctxFunction · 0.45
build_schemaFunction · 0.45
fetch_jwksFunction · 0.45
read_parquet_filteredFunction · 0.45
make_test_parquetFunction · 0.45
build_object_storeFunction · 0.45
newMethod · 0.45

Calls 4

collectMethod · 0.80
dedupMethod · 0.80
to_stringMethod · 0.80
to_vecMethod · 0.45

Tested by 15

schemaFunction · 0.36
test_schemaFunction · 0.36
test_schemaFunction · 0.36
schemaFunction · 0.36
schemaFunction · 0.36
schemaFunction · 0.36
schemaFunction · 0.36
genomic_schemaFunction · 0.36
simple_schemaFunction · 0.36