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

Function test_dictionary_ree_resend

arrow-flight/src/encode.rs:1602–1625  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1600
1601 #[tokio::test]
1602 async fn test_dictionary_ree_resend() {
1603 let dict_values1 = vec![Some("a"), None, Some("b")]
1604 .into_iter()
1605 .collect::<DictionaryArray<Int32Type>>();
1606 let run_ends1 = Int32Array::from(vec![1, 2, 3]);
1607 let arr1 = RunArray::try_new(&run_ends1, &dict_values1).unwrap();
1608
1609 let dict_values2 = vec![Some("c"), Some("a")]
1610 .into_iter()
1611 .collect::<DictionaryArray<Int32Type>>();
1612 let run_ends2 = Int32Array::from(vec![1, 2]);
1613 let arr2 = RunArray::try_new(&run_ends2, &dict_values2).unwrap();
1614
1615 let schema = Arc::new(Schema::new(vec![Field::new(
1616 "ree",
1617 arr1.data_type().clone(),
1618 true,
1619 )]));
1620
1621 let batch1 = RecordBatch::try_new(schema.clone(), vec![Arc::new(arr1)]).unwrap();
1622 let batch2 = RecordBatch::try_new(schema, vec![Arc::new(arr2)]).unwrap();
1623
1624 verify_flight_round_trip(vec![batch1, batch2]).await;
1625 }
1626
1627 #[tokio::test]
1628 async fn test_dictionary_of_struct_of_dict_resend() {

Callers

nothing calls this directly

Calls 4

try_newFunction · 0.85
verify_flight_round_tripFunction · 0.85
into_iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected