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

Method is_valid

datafusion/common/src/functional_dependencies.rs:246–265  ·  view source on GitHub ↗

Sanity checks if functional dependencies are valid. For example, if there are 10 fields, we cannot receive any index further than 9.

(&self, n_field: usize)

Source from the content-addressed store, hash-verified

244 /// Sanity checks if functional dependencies are valid. For example, if
245 /// there are 10 fields, we cannot receive any index further than 9.
246 pub fn is_valid(&self, n_field: usize) -> bool {
247 self.deps.iter().all(
248 |FunctionalDependence {
249 source_indices,
250 target_indices,
251 ..
252 }| {
253 source_indices
254 .iter()
255 .max()
256 .map(|&max_index| max_index < n_field)
257 .unwrap_or(true)
258 && target_indices
259 .iter()
260 .max()
261 .map(|&max_index| max_index < n_field)
262 .unwrap_or(true)
263 },
264 )
265 }
266
267 /// Adds the `offset` value to `source_indices` and `target_indices` for
268 /// each functional dependency.

Callers 10

hash_dictionary_innerFunction · 0.45
hash_map_arrayFunction · 0.45
hash_list_arrayFunction · 0.45
hash_list_view_arrayFunction · 0.45
hash_fixed_list_arrayFunction · 0.45
partial_cmp_listFunction · 0.45
partial_cmp_structFunction · 0.45
partial_cmp_mapFunction · 0.45
dict_from_valuesFunction · 0.45

Calls 4

allMethod · 0.80
iterMethod · 0.45
mapMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected