MCPcopy Create free account
hub / github.com/apache/paimon-rust / test_string_keys

Function test_string_keys

crates/paimon/src/btree/tests.rs:225–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223
224#[tokio::test]
225async fn test_string_keys() {
226 let buf = VecFileWrite::new();
227 let mut writer = BTreeIndexWriter::new(Box::new(buf.clone()), 64, BlockCompressionType::None);
228
229 let keys = ["apple", "banana", "cherry", "date", "elderberry"];
230 for (i, k) in keys.iter().enumerate() {
231 writer.write(Some(k.as_bytes()), i as i64).await.unwrap();
232 }
233
234 let result = writer.finish().await.unwrap();
235 let reader = write_and_open(&buf, &result, |a, b| a.cmp(b)).await;
236
237 let bm = reader.query_equal(b"apple").await.unwrap();
238 assert!(bm.contains(0));
239 let bm = reader.query_equal(b"elderberry").await.unwrap();
240 assert!(bm.contains(4));
241}
242
243#[tokio::test]
244async fn test_string_keys_query() {

Callers

nothing calls this directly

Calls 6

write_and_openFunction · 0.85
cmpMethod · 0.80
query_equalMethod · 0.80
iterMethod · 0.45
writeMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected