MCPcopy Create free account
hub / github.com/apache/arrow-rs / list_array_equality

Function list_array_equality

arrow-array/src/array/list_array.rs:1163–1232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1161
1162 #[test]
1163 fn list_array_equality() {
1164 // test scaffold
1165 fn do_comparison(
1166 lhs_data: Vec<Option<Vec<Option<i32>>>>,
1167 rhs_data: Vec<Option<Vec<Option<i32>>>>,
1168 should_equal: bool,
1169 ) {
1170 let lhs = ListArray::from_iter_primitive::<Int32Type, _, _>(lhs_data.clone());
1171 let rhs = ListArray::from_iter_primitive::<Int32Type, _, _>(rhs_data.clone());
1172 assert_eq!(lhs == rhs, should_equal);
1173
1174 let lhs = LargeListArray::from_iter_primitive::<Int32Type, _, _>(lhs_data);
1175 let rhs = LargeListArray::from_iter_primitive::<Int32Type, _, _>(rhs_data);
1176 assert_eq!(lhs == rhs, should_equal);
1177 }
1178
1179 do_comparison(
1180 vec![
1181 Some(vec![Some(0), Some(1), Some(2)]),
1182 None,
1183 Some(vec![Some(3), None, Some(5)]),
1184 Some(vec![Some(6), Some(7)]),
1185 ],
1186 vec![
1187 Some(vec![Some(0), Some(1), Some(2)]),
1188 None,
1189 Some(vec![Some(3), None, Some(5)]),
1190 Some(vec![Some(6), Some(7)]),
1191 ],
1192 true,
1193 );
1194
1195 do_comparison(
1196 vec![
1197 None,
1198 None,
1199 Some(vec![Some(3), None, Some(5)]),
1200 Some(vec![Some(6), Some(7)]),
1201 ],
1202 vec![
1203 Some(vec![Some(0), Some(1), Some(2)]),
1204 None,
1205 Some(vec![Some(3), None, Some(5)]),
1206 Some(vec![Some(6), Some(7)]),
1207 ],
1208 false,
1209 );
1210
1211 do_comparison(
1212 vec![
1213 None,
1214 None,
1215 Some(vec![Some(3), None, Some(5)]),
1216 Some(vec![Some(6), Some(7)]),
1217 ],
1218 vec![
1219 None,
1220 None,

Callers

nothing calls this directly

Calls 1

do_comparisonFunction · 0.85

Tested by

no test coverage detected