MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / test_multidimensional_array

Function test_multidimensional_array

src/repr/src/row.rs:3768–3803  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3766
3767 #[mz_ore::test]
3768 fn test_multidimensional_array() {
3769 let datums = vec![
3770 Datum::Int32(1),
3771 Datum::Int32(2),
3772 Datum::Int32(3),
3773 Datum::Int32(4),
3774 Datum::Int32(5),
3775 Datum::Int32(6),
3776 Datum::Int32(7),
3777 Datum::Int32(8),
3778 ];
3779
3780 let mut row = Row::default();
3781 let mut packer = row.packer();
3782 packer
3783 .try_push_array(
3784 &[
3785 ArrayDimension {
3786 lower_bound: 1,
3787 length: 1,
3788 },
3789 ArrayDimension {
3790 lower_bound: 1,
3791 length: 4,
3792 },
3793 ArrayDimension {
3794 lower_bound: 1,
3795 length: 2,
3796 },
3797 ],
3798 &datums,
3799 )
3800 .unwrap();
3801 let array = row.unpack_first().unwrap_array();
3802 assert_eq!(array.elements().into_iter().collect::<Vec<_>>(), datums);
3803 }
3804
3805 #[mz_ore::test]
3806 fn test_array_max_dimensions() {

Callers

nothing calls this directly

Calls 5

packerMethod · 0.80
unwrapMethod · 0.80
try_push_arrayMethod · 0.80
unwrap_arrayMethod · 0.80
unpack_firstMethod · 0.80

Tested by

no test coverage detected