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

Function create_dictionary_array

arrow/tests/array_equal.rs:1072–1084  ·  view source on GitHub ↗
(values: &[&str], keys: &[Option<&str>])

Source from the content-addressed store, hash-verified

1070}
1071
1072fn create_dictionary_array(values: &[&str], keys: &[Option<&str>]) -> DictionaryArray<Int16Type> {
1073 let values = StringArray::from(values.to_vec());
1074 let mut builder =
1075 StringDictionaryBuilder::<Int16Type>::new_with_dictionary(keys.len(), &values).unwrap();
1076 for key in keys {
1077 if let Some(v) = key {
1078 builder.append(v).unwrap();
1079 } else {
1080 builder.append_null()
1081 }
1082 }
1083 builder.finish()
1084}
1085
1086#[test]
1087fn test_dictionary_equal() {

Callers 2

test_dictionary_equalFunction · 0.70

Calls 4

lenMethod · 0.45
appendMethod · 0.45
append_nullMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected