Skip to content

Commit

Permalink
add test showing that timeless doesn't respect RowId ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Nov 27, 2023
1 parent ba1bba9 commit 4a12a05
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions crates/re_arrow_store/tests/correctness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,46 @@ fn row_id_ordering_semantics() -> anyhow::Result<()> {
}
}

// Timeless is RowId-ordered too!
//
// * Insert timeless `point1` with a random `RowId`.
// * Insert timeless `point2` using `point1`'s `RowId`, decremented by one.
// * Query timelessly and make sure we get `point1` because of timeless tie-breaks.
{
let mut store = DataStore::new(
re_log_types::StoreId::random(re_log_types::StoreKind::Recording),
InstanceKey::name(),
Default::default(),
);

let row_id1 = RowId::random();
let row_id2 = row_id1.next();

let row = DataRow::from_component_batches(
row_id2,
TimePoint::timeless(),
entity_path.clone(),
[&[point1] as _],
)?;
store.insert_row(&row)?;

let row = DataRow::from_component_batches(
row_id1,
TimePoint::timeless(),
entity_path.clone(),
[&[point2] as _],
)?;
store.insert_row(&row)?;

{
let got_point = store
.query_timeless_component::<MyPoint>(&entity_path)
.unwrap()
.value;
similar_asserts::assert_eq!(point1, got_point);
}
}

Ok(())
}

Expand Down

0 comments on commit 4a12a05

Please sign in to comment.