Skip to main content

Module df_expr

Module df_expr 

Source
Expand description

Translation layer from Cypher expressions to DataFusion expressions.

This module provides cypher_expr_to_df which converts Cypher AST expressions into DataFusion physical expressions suitable for use in DataFusion execution plans.

§Property Naming Convention

Properties are materialized as columns with the naming convention {variable}.{property}. For example, n.age becomes column "n.age".

§Supported Expressions

  • Identifiers and property access
  • Literal values (numbers, strings, booleans, null)
  • Binary operators (comparison, arithmetic, boolean)
  • Unary operators (NOT, negation)
  • IS NULL / IS NOT NULL
  • String operations (CONTAINS, STARTS WITH, ENDS WITH)
  • IN list checks
  • CASE expressions

§Unsupported Expressions

Some Cypher expressions require custom handling and are not yet supported:

  • List comprehensions
  • Reduce expressions
  • Subqueries (EXISTS, scalar subqueries)
  • Approximate equality (~=) for vectors

Structs§

TranslationContext
Context for expression translation.

Enums§

VariableKind
Entity kind of a variable in the physical query context.

Functions§

apply_type_coercion
Apply type coercion to a DataFusion expression.
collect_properties
Collect all property accesses from an expression tree.
cypher_expr_to_df
Convert a Cypher expression to a DataFusion expression.
wider_numeric_type
Returns the wider of two numeric DataTypes for type coercion.