Skip to content

Commit 02e7409

Browse files
committed
Use layout type checks for zoned tests
Replace encoding-id string matching with layout.is::<Zoned>() and layout.is::<LegacyStats>() in the zoned segment-ordering test. Signed-off-by: "Nicholas Gates" <[email protected]> Signed-off-by: Nicholas Gates <[email protected]>
1 parent ef97030 commit 02e7409

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎vortex-file/src/tests.rs‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ use vortex_buffer::buffer;
6363
use vortex_error::VortexResult;
6464
use vortex_io::session::RuntimeSession;
6565
use vortex_layout::Layout;
66+
use vortex_layout::layouts::zoned::LegacyStats;
67+
use vortex_layout::layouts::zoned::Zoned;
6668
use vortex_layout::scan::scan_builder::ScanBuilder;
6769
use vortex_layout::session::LayoutSession;
6870
use vortex_session::VortexSession;
@@ -1886,10 +1888,7 @@ async fn test_segment_ordering_zonemaps_after_data() -> VortexResult<()> {
18861888

18871889
// Find all zoned layouts and verify data segments come before zone map segments.
18881890
fn check_zoned_ordering(layout: &dyn Layout, segment_specs: &[SegmentSpec]) {
1889-
if matches!(
1890-
layout.encoding_id().as_ref(),
1891-
"vortex.zoned" | "vortex.stats"
1892-
) {
1891+
if layout.is::<Zoned>() || layout.is::<LegacyStats>() {
18931892
// child 0 = data, child 1 = zones
18941893
let data_offsets =
18951894
collect_segment_offsets(layout.child(0).unwrap().as_ref(), segment_specs);
@@ -1921,10 +1920,7 @@ async fn test_segment_ordering_zonemaps_after_data() -> VortexResult<()> {
19211920
all_data: &mut Vec<u64>,
19221921
all_zones: &mut Vec<u64>,
19231922
) {
1924-
if matches!(
1925-
layout.encoding_id().as_ref(),
1926-
"vortex.zoned" | "vortex.stats"
1927-
) {
1923+
if layout.is::<Zoned>() || layout.is::<LegacyStats>() {
19281924
// child 0 = data, child 1 = zones
19291925
all_data.extend(collect_segment_offsets(
19301926
layout.child(0).unwrap().as_ref(),

0 commit comments

Comments
 (0)