datafusion_functions::core::expr_ext

Trait FieldAccessor

Source
pub trait FieldAccessor {
    // Required method
    fn field(self, name: impl Literal) -> Expr;
}
Expand description

Return access to the named field. Example expr["name"]

§Access field “my_field” from column “c1”

For example if column “c1” holds documents like this

{
  "my_field": 123.34,
  "other_field": "Boston",
}

You can access column “my_field” with

let expr = col("c1")
   .field("my_field");
assert_eq!(expr.schema_name().to_string(), "c1[my_field]");

Required Methods§

Source

fn field(self, name: impl Literal) -> Expr

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FieldAccessor for Expr

Source§

fn field(self, name: impl Literal) -> Expr

Implementors§