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

Function test_run_array_with_nulls

datafusion/common/src/hash_utils.rs:2043–2065  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2041 #[test]
2042 #[cfg(not(feature = "force_hash_collisions"))]
2043 fn test_run_array_with_nulls() -> Result<()> {
2044 let values = Arc::new(Int32Array::from(vec![Some(10), None, Some(20)]));
2045 let run_ends = Arc::new(Int32Array::from(vec![2, 4, 6]));
2046 let array = Arc::new(RunArray::try_new(&run_ends, values.as_ref()).unwrap());
2047
2048 let random_state = RandomState::with_seed(0);
2049 let mut hashes = vec![0; array.len()];
2050 create_hashes(
2051 &[Arc::clone(&array) as ArrayRef],
2052 &random_state,
2053 &mut hashes,
2054 )?;
2055
2056 assert_eq!(hashes[0], hashes[1]);
2057 assert_ne!(hashes[0], 0);
2058 assert_eq!(hashes[2], hashes[3]);
2059 assert_eq!(hashes[2], 0);
2060 assert_eq!(hashes[4], hashes[5]);
2061 assert_ne!(hashes[4], 0);
2062 assert_ne!(hashes[0], hashes[4]);
2063
2064 Ok(())
2065 }
2066
2067 #[test]
2068 #[cfg(not(feature = "force_hash_collisions"))]

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
create_hashesFunction · 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…