Path: blob/main/crates/polars-plan/src/dsl/function_expr/struct_.rs
8408 views
use super::*;12#[derive(Clone, Eq, PartialEq, Hash, Debug)]3#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]4#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]5pub enum StructFunction {6FieldByName(PlSmallStr),7RenameFields(Arc<[PlSmallStr]>),8PrefixFields(PlSmallStr),9SuffixFields(PlSmallStr),10#[cfg(feature = "json")]11JsonEncode,12SelectFields(Selector),13MapFieldNames(PlanCallback<PlSmallStr, PlSmallStr>),14}1516impl Display for StructFunction {17fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {18use StructFunction::*;19match self {20FieldByName(name) => write!(f, "struct.field_by_name({name})"),21RenameFields(names) => write!(f, "struct.rename_fields({names:?})"),22PrefixFields(_) => write!(f, "name.prefix_fields"),23SuffixFields(_) => write!(f, "name.suffixFields"),24#[cfg(feature = "json")]25JsonEncode => write!(f, "struct.to_json"),26SelectFields(_) => write!(f, "struct.field"),27MapFieldNames(_) => write!(f, "map_field_names"),28}29}30}313233