field_path_to_expr

Function field_path_to_expr 

Source
pub fn field_path_to_expr(field_path: &str) -> Result<Expr>
Expand description

Convert a field path string into a DataFusion expression.

This function handles:

  • Simple column names: “column”
  • Nested paths: “parent.child” or “parent.child.grandchild”
  • Backtick-escaped field names: “parent.field.with.dots

§Arguments

  • field_path - The field path to convert. Supports simple columns, nested paths, and backtick-escaped field names.

§Returns

Returns Result<Expr> - Ok with the DataFusion expression, or Err if the path could not be parsed.

§Example

use lance_datafusion::logical_expr::field_path_to_expr;

// Simple column
let expr = field_path_to_expr("column_name").unwrap();

// Nested field
let expr = field_path_to_expr("parent.child").unwrap();

// Backtick-escaped field with dots
let expr = field_path_to_expr("parent.`field.with.dots`").unwrap();