gravitino.dto.rel.expressions.field_reference_dto.FieldReferenceDTO¶
- class gravitino.dto.rel.expressions.field_reference_dto.FieldReferenceDTO(field_name: List[str])¶
Bases:
NamedReference
,FunctionArg
Data transfer object representing a field reference.
- __init__(field_name: List[str])¶
Methods
__init__
(field_name)arg_type
()Arguments type of the function.
builder
()The builder for creating a new instance of FieldReferenceDTO.
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.
Returns the referenced field name as a list of string parts.
Named references reference themselves.
validate
(columns)Validates the function argument.
Attributes
EMPTY_ARGS
EMPTY_EXPRESSION is only used as an input when the default children method builds the result.
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.
- class ArgType(value)¶
Bases:
str
,Enum
The type of the argument.
The supported types are:
LITERAL: A literal argument.
FIELD: A field argument.
FUNCTION: A function argument.
UNPARSED: An unparsed argument.
- class Builder¶
Bases:
object
Builder for FieldRererenceDTO
- build() FieldReferenceDTO ¶
Build the field reference.
- Returns:
FieldReferenceDTO: The field reference.
- 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.
- static builder() Builder ¶
The builder for creating a new instance of FieldReferenceDTO.
- Returns:
Builder: The builder for creating a new instance of FieldReferenceDTO.
- children() list[gravitino.api.expressions.expression.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[gravitino.api.expressions.named_reference.NamedReference] ¶
Named references reference themselves.