Expressions API#

Expressions provide a way to specify column-based operations on datasets. Use col() to reference columns and lit() to create literal values. These can be combined with operators to create complex expressions for filtering, transformations, and computations.

Public API#

col

Reference an existing column by name.

lit

Create a literal expression from a constant value.

Expression Classes#

These classes represent the structure of expressions. You typically don’t need to instantiate them directly, but you may encounter them when working with expressions.

Expr

Base class for all expression nodes.

ColumnExpr

Expression that references a column by name.

LiteralExpr

Expression that represents a constant scalar value.

BinaryExpr

Expression that represents a binary operation between two expressions.