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

Function test_with_hashes_multi_column

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

Source from the content-addressed store, hash-verified

1832
1833 #[test]
1834 fn test_with_hashes_multi_column() {
1835 let int_array: ArrayRef = Arc::new(Int32Array::from(vec![1, 2, 3]));
1836 let str_array: ArrayRef = Arc::new(StringArray::from(vec!["a", "b", "c"]));
1837 let random_state = RandomState::with_seed(0);
1838
1839 // Test multi-column hashing
1840 let mut expected_hashes = vec![0; int_array.len()];
1841 create_hashes(
1842 [&int_array, &str_array],
1843 &random_state,
1844 &mut expected_hashes,
1845 )
1846 .unwrap();
1847
1848 with_hashes([&int_array, &str_array], &random_state, |hashes| {
1849 assert_eq!(hashes.len(), 3);
1850 assert_eq!(hashes, &expected_hashes[..]);
1851 Ok(())
1852 })
1853 .unwrap();
1854 }
1855
1856 #[test]
1857 fn test_with_hashes_empty_arrays() {

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
create_hashesFunction · 0.85
with_hashesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…