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

Function flatten

datafusion/common/src/scalar/mod.rs:835–846  ·  view source on GitHub ↗
(array: &'a StructArray, columns: &mut Vec<&'a ArrayRef>)

Source from the content-addressed store, hash-verified

833}
834
835fn flatten<'a>(array: &'a StructArray, columns: &mut Vec<&'a ArrayRef>) {
836 for i in 0..array.num_columns() {
837 let column = array.column(i);
838 if let Some(nested_struct) = column.as_any().downcast_ref::<StructArray>() {
839 // If it's a nested struct, recursively expand
840 flatten(nested_struct, columns);
841 } else {
842 // If it's a primitive type, add directly
843 columns.push(column);
844 }
845 }
846}
847
848pub fn partial_cmp_struct(s1: &StructArray, s2: &StructArray) -> Option<Ordering> {
849 if s1.len() != s2.len() {

Callers 1

partial_cmp_structFunction · 0.85

Calls 3

columnMethod · 0.80
as_anyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…