Trait datafusion_functions::core::expr_ext::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.display_name().unwrap(), "c1[my_field]");

Required Methods§

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FieldAccessor for Expr

source§

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

Implementors§