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§
- Translation
Context - Context for expression translation.
Enums§
- Variable
Kind - Entity kind of a variable in the physical query context.
Functions§
- apply_
type_ coercion - Apply type coercion to a DataFusion expression.
- cast_
expr - Create a cast expression to the specified data type.
- collect_
properties - Collect all property accesses from an expression tree.
- comparison_
udf_ name - Map a comparison operator to its
_cypher_*UDF name. - cypher_
expr_ to_ df - Convert a Cypher expression to a DataFusion expression.
- dummy_
udf_ expr - Helper to create a DummyUdf wrapped in a ScalarFunction expression.
- extract_
datetime_ nanos - Extract the
nanos_since_epochfield from a DateTime struct expression. - extract_
time_ nanos - Extract the UTC-normalized time in nanoseconds from a Time struct expression.
- list_
to_ large_ binary_ expr - Wrap a
List<T>orLargeList<T>expression as aLargeBinaryCypherValue. - normalize_
datetime_ str - Insert
:00seconds into a datetime string like2021-06-01T00:00Zthat has onlyHH:MMafter theTseparator (no seconds component). - scalar_
to_ large_ binary_ expr - Wrap a native scalar expression (Int64, Float64, Utf8, Boolean, etc.) in the
_cypher_scalar_to_cvUDF so it becomes CypherValue-encoded LargeBinary. Used to normalize mixed-type coalesce arguments. - struct_
getfield - Extract a named field from a struct expression using DataFusion’s
get_fieldfunction. - wider_
numeric_ type - Returns the wider of two numeric DataTypes for type coercion.