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

Method alias_qualified_with_metadata

datafusion/expr/src/expr.rs:1836–1843  ·  view source on GitHub ↗

Return `self AS name` alias expression with a specific qualifier and 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())])

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

Source from the content-addressed store, hash-verified

1834 /// col("foo").alias_qualified_with_metadata(Some("tbl"), "bar", Some(metadata));
1835 /// ```
1836 pub fn alias_qualified_with_metadata(
1837 self,
1838 relation: Option<impl Into<TableReference>>,
1839 name: impl Into<String>,
1840 metadata: Option<FieldMetadata>,
1841 ) -> Expr {
1842 Expr::Alias(Alias::new(self, relation, name.into()).with_metadata(metadata))
1843 }
1844
1845 /// Remove an alias from an expression if one exists.
1846 ///

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected