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

Function scatter_string_test

datafusion/physical-expr-common/src/utils.rs:550–565  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

548
549 #[test]
550 fn scatter_string_test() -> Result<()> {
551 let truthy = Arc::new(StringArray::from(vec!["hello", "world"]));
552 let mask = BooleanArray::from(vec![true, false, false, true]);
553
554 let result = scatter(&mask, truthy.as_ref())?;
555 let result = as_string_array(&result);
556
557 assert_eq!(result.len(), 4);
558 assert!(result.is_valid(0));
559 assert_eq!(result.value(0), "hello");
560 assert!(result.is_null(1));
561 assert!(result.is_null(2));
562 assert!(result.is_valid(3));
563 assert_eq!(result.value(3), "world");
564 Ok(())
565 }
566
567 #[test]
568 fn scatter_string_view_test() -> Result<()> {

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
scatterFunction · 0.85
as_string_arrayFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…