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

Function test_string_keys_query

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

Source from the content-addressed store, hash-verified

242
243#[tokio::test]
244async fn test_string_keys_query() {
245 let buf = VecFileWrite::new();
246 let mut writer = BTreeIndexWriter::new(Box::new(buf.clone()), 64, BlockCompressionType::None);
247
248 let keys = ["apple", "banana", "cherry", "date", "elderberry"];
249 for (i, k) in keys.iter().enumerate() {
250 writer.write(Some(k.as_bytes()), i as i64).await.unwrap();
251 }
252
253 let result = writer.finish().await.unwrap();
254 let reader = write_and_open(&buf, &result, |a, b| a.cmp(b)).await;
255
256 let bm = reader.query_equal(b"cherry").await.unwrap();
257 assert_eq!(bm.len(), 1);
258 assert!(bm.contains(2));
259}
260
261#[tokio::test]
262async fn test_large_dataset() {

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