MCPcopy Create free account
hub / github.com/apache/datafusion / test_dict_values_null

Function test_dict_values_null

datafusion/spark/src/function/math/hex.rs:551–572  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

549
550 #[test]
551 fn test_dict_values_null() {
552 let keys = Int32Array::from(vec![Some(0), None, Some(1)]);
553 let vals = Int64Array::from(vec![Some(32), None]);
554 // [32, null, null]
555 let dict = DictionaryArray::new(keys, Arc::new(vals));
556
557 let columnar_value = ColumnarValue::Array(Arc::new(dict));
558 let result = super::spark_hex(&[columnar_value]).unwrap();
559
560 let result = match result {
561 ColumnarValue::Array(array) => array,
562 _ => panic!("Expected array"),
563 };
564
565 let result = as_dictionary_array(&result).unwrap();
566
567 let keys = Int32Array::from(vec![Some(0), None, Some(1)]);
568 let vals = StringArray::from(vec![Some("20"), None]);
569 let expected = DictionaryArray::new(keys, Arc::new(vals));
570
571 assert_eq!(&expected, result);
572 }
573}

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
spark_hexFunction · 0.85
as_dictionary_arrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…