gravitino.dto.rel.expressions.func_expression_dto.FuncExpressionDTO

class gravitino.dto.rel.expressions.func_expression_dto.FuncExpressionDTO(function_name: str, function_args: List[FunctionArg])

Bases: FunctionExpression, FunctionArg

__init__(function_name: str, function_args: List[FunctionArg])

Methods

__init__(function_name, function_args)

arg_type()

Arguments type of the function.

args()

The function arguments.

arguments()

Returns the arguments passed to the function.

builder()

The builder for creating a new instance of FuncExpressionDTO.

children()

Returns the arguments as children.

function_name()

Returns the function name.

of(function_name, *arguments)

Creates a new FunctionExpression with the given function name.

references()

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

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

build() FuncExpressionDTO

Build the function expression.

Returns:

FuncExpressionDTO: The function expression.

with_function_args(function_args: List[FunctionArg]) Builder

Set the function arguments for the function expression.

Args:

function_args (List[FunctionArg]): The function arguments.

Returns:

FuncExpressionDTO.Builder: The builder.

with_function_name(function_name: str) Builder

Set the function name for the function expression.

Args:

function_name (str): The function name.

Returns:

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

args() List[FunctionArg]

The function arguments.

Returns:

List[FunctionArg]: The function arguments.

arguments() List[Expression]

Returns the arguments passed to the function.

static builder() Builder

The builder for creating a new instance of FuncExpressionDTO.

Returns:

Builder: The builder for creating a new instance of FuncExpressionDTO.

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

Returns the arguments as children.

function_name() str

Returns the function name.

static of(function_name: str, *arguments: Expression) FuncExpressionImpl

Creates a new FunctionExpression with the given function name. If no arguments are provided, it uses an empty expression.

Parameters:
  • function_name – The name of the function.

  • arguments – The arguments to the function (optional).

Returns:

The created FunctionExpression.

references() List[NamedReference]

Returns a list of fields or columns that are referenced by this 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.