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

Method alias_with_metadata

datafusion/expr/src/expr.rs:1804–1810  ·  view source on GitHub ↗

Return `self AS name` alias expression with metadata The metadata will be attached to the Arrow Schema field when the expression is converted to a field via `Expr.to_field()`. # Example ``` # use datafusion_expr::col; # use std::collections::HashMap; # use datafusion_common::metadata::FieldMetadata; let metadata = HashMap::from([("key".to_string(), "value".to_string())]); let metadata = FieldMet

(
        self,
        name: impl Into<String>,
        metadata: Option<FieldMetadata>,
    )

Source from the content-addressed store, hash-verified

1802 /// let expr = col("foo").alias_with_metadata("bar", Some(metadata));
1803 /// ```
1804 pub fn alias_with_metadata(
1805 self,
1806 name: impl Into<String>,
1807 metadata: Option<FieldMetadata>,
1808 ) -> Expr {
1809 Expr::Alias(Alias::new(self, None::<&str>, name.into()).with_metadata(metadata))
1810 }
1811
1812 /// Return `self AS name` alias expression with a specific qualifier
1813 pub fn alias_qualified(

Calls 4

AliasClass · 0.85
newFunction · 0.85
with_metadataMethod · 0.45
intoMethod · 0.45