gravitino.dto.rel.expressions.unparsed_expression_dto.UnparsedExpressionDTO

class gravitino.dto.rel.expressions.unparsed_expression_dto.UnparsedExpressionDTO(unparsed_expression: str)

Bases: UnparsedExpression, FunctionArg

Data transfer object representing an unparsed expression.

__init__(unparsed_expression: str)

Methods

__init__(unparsed_expression)

arg_type()

Arguments type of the function.

builder()

A builder instance for UnparsedExpressionDTO.

children()

Unparsed expressions do not have children.

of(unparsed_expression)

Creates a new UnparsedExpression with the given unparsed expression.

references()

Returns a list of fields or columns that are referenced by this expression.

unparsed_expression()

Returns the unparsed expression as a string.

validate(columns)

Validates the function argument.

Attributes

EMPTY_ARGS

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.

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 UnparsedExpressionDTO.

build() UnparsedExpressionDTO

Build the unparsed expression.

Returns:

UnparsedExpressionDTO: The unparsed expression.

with_unparsed_expression(unparsed_expression: str) Builder

Set the unparsed expression.

Args:

unparsed_expression (str): The unparsed expression.

Returns:

Builder: The builder.

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.

arg_type() ArgType

Arguments type of the function.

Returns:

ArgType: The type of this argument.

static builder() Builder

A builder instance for UnparsedExpressionDTO.

Returns:

Builder: A builder instance for UnparsedExpressionDTO.

children() list[gravitino.api.expressions.expression.Expression]

Unparsed expressions do not have children.

static of(unparsed_expression: str) UnparsedExpressionImpl

Creates a new UnparsedExpression with the given unparsed expression.

Parameters:

unparsed_expression – The unparsed expression as a string.

Returns:

The created UnparsedExpression.

references() List[NamedReference]

Returns a list of fields or columns that are referenced by this expression.

unparsed_expression() str

Returns the unparsed expression as a string.

Returns:

str: The value of the unparsed expression.

validate(columns: List[ColumnDTO]) None

Validates the function argument.

Args:

columns (List[ColumnDTO]): The columns of the table.

Raises:

IllegalArgumentException: If the function argument is invalid.