Skip to content

Commit 6a79bcf

Browse files
authored
Fix CUDA ListView dictionary export regression test (#8876)
## Rationale for this change The PiecewiseSequence ListView rebuild now preserves dictionary encoding for large lists. The cuda export regression test still expected the previous, incidentally canonicalised Int32 child layout Signed-off-by: Onur Satici <onur@spiraldb.com>
1 parent c66add6 commit 6a79bcf

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

vortex-cuda/src/arrow/canonical.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,9 +2805,8 @@ mod tests {
28052805
Ok(())
28062806
}
28072807

2808-
// Regression test: with an average list size >= 128 the host list-view rebuild picks its
2809-
// list-by-list strategy, which may canonicalize Dict elements. The schema must describe the
2810-
// rebuilt child layout.
2808+
// Regression test: the host list-view rebuild uses a take for large lists, which preserves
2809+
// dictionary elements. The schema must describe the rebuilt child layout.
28112810
#[crate::test]
28122811
async fn test_export_host_large_lists_dictionary_list_view_schema_matches_rebuilt_child()
28132812
-> VortexResult<()> {
@@ -2836,7 +2835,17 @@ mod tests {
28362835
field,
28372836
Field::new_list(
28382837
"",
2839-
Field::new(Field::LIST_FIELD_DEFAULT_NAME, DataType::Int32, true),
2838+
Field::new(
2839+
Field::LIST_FIELD_DEFAULT_NAME,
2840+
DataType::Dictionary(
2841+
Box::new(DataType::Int64),
2842+
Box::new(DataType::Dictionary(
2843+
Box::new(DataType::Int16),
2844+
Box::new(DataType::Int32),
2845+
)),
2846+
),
2847+
true,
2848+
),
28402849
false,
28412850
)
28422851
);
@@ -2846,9 +2855,11 @@ mod tests {
28462855
);
28472856
let list_children = unsafe { std::slice::from_raw_parts(exported.array.array.children, 1) };
28482857
let child = unsafe { &*list_children[0] };
2849-
assert!(child.dictionary.is_null());
2858+
assert!(!child.dictionary.is_null());
28502859
assert_eq!(child.length, 256);
28512860
assert_eq!(child.n_buffers, 2);
2861+
let nested_dict = unsafe { &*child.dictionary };
2862+
assert!(!nested_dict.dictionary.is_null());
28522863

28532864
unsafe { release_exported_array(&raw mut exported.array.array) };
28542865
Ok(())

0 commit comments

Comments
 (0)