gravitino.api.expressions.named_reference.NamedReference

class gravitino.api.expressions.named_reference.NamedReference

Bases: Expression

Represents a field or column reference in the public logical expression API.

__init__()

Methods

__init__()

children()

Named references do not have children.

field(field_name)

Returns a FieldReference for the given field name(s).

field_from_column(column_name)

Returns a FieldReference for the given column name.

field_name()

Returns the referenced field name as a list of string parts.

references()

Named references reference themselves.

Attributes

EMPTY_EXPRESSION

EMPTY_EXPRESSION is only used as an input when the default children method builds the result.

EMPTY_NAMED_REFERENCE

EMPTY_NAMED_REFERENCE is only used as an input when the default references method builds the result array to avoid repeatedly allocating an empty array.

EMPTY_EXPRESSION: List[Expression] = []

EMPTY_EXPRESSION is only used as an input when the default children method builds the result.

EMPTY_NAMED_REFERENCE: List[NamedReference] = []

EMPTY_NAMED_REFERENCE is only used as an input when the default references method builds the result array to avoid repeatedly allocating an empty array.

children() list[Expression]

Named references do not have children.

static field(field_name: list[str]) FieldReference

Returns a FieldReference for the given field name(s). The array of field name(s) is used to reference nested fields. For example, if we have a struct column named “student” with a data type of StructType{“name”: StringType, “age”: IntegerType}, we can reference the field “name” by calling field(“student”, “name”).

@param field_name the field name(s) @return a FieldReference for the given field name(s)

static field_from_column(column_name: str) FieldReference

Returns a FieldReference for the given column name.

field_name() list[str]

Returns the referenced field name as a list of string parts. Must be implemented by subclasses.

references() list[NamedReference]

Named references reference themselves.