gravitino.dto.rel.partitioning.truncate_partitioning_dto.TruncatePartitioningDTO¶
- class gravitino.dto.rel.partitioning.truncate_partitioning_dto.TruncatePartitioningDTO(width: int, field_name: List[str])¶
Bases:
PartitioningRepresents the truncate partitioning.
- Attributes:
_width (int): The width of the truncate partitioning. _field_name (List[str]): The name of the field to partition.
- __init__(width: int, field_name: List[str])¶
Methods
__init__(width, field_name)Returns the arguments of the partitioning strategy.
Gets the preassigned partitions in the partitioning.
children()Returns a list of the children of this node.
Returns the name of the field to partition.
get_by_name(name)Gets the partitioning strategy by name.
name()Gets the transform function name.
Returns a list of fields or columns that are referenced by this expression.
strategy()Returns the name of the partitioning strategy.
validate(columns)Validates the partitioning columns.
width()Returns the width of the partitioning.
Attributes
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.
An empty array of partitioning.
- 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.
- EMPTY_PARTITIONING: Final[List[Partitioning]] = []¶
An empty array of partitioning.
- class Strategy(value)¶
Bases:
str,EnumRepresents a partitioning strategy.
- BUCKET = 'bucket'¶
The bucket partitioning strategy.
- DAY = 'day'¶
The day partitioning strategy.
- FUNCTION = 'function'¶
The function partitioning strategy.
- HOUR = 'hour'¶
The hour partitioning strategy.
- IDENTITY = 'identity'¶
The identity partitioning strategy.
- LIST = 'list'¶
The list partitioning strategy.
- MONTH = 'month'¶
The month partitioning strategy.
- RANGE = 'range'¶
The range partitioning strategy.
- TRUNCATE = 'truncate'¶
The truncate partitioning strategy.
- YEAR = 'year'¶
The year partitioning strategy.
- arguments() List[Expression]¶
Returns the arguments of the partitioning strategy.
- Returns:
List[Expression]: The arguments of the partitioning strategy.
- assignments() List[Partition]¶
Gets the preassigned partitions in the partitioning.
Currently, only Transforms.ListTransform and Transforms.RangeTransform need to deal with assignments
- Returns:
List[Partition]: The preassigned partitions in the partitioning.
- children() List[Expression]¶
Returns a list of the children of this node. Children should not change.
- field_name() List[str]¶
Returns the name of the field to partition.
- Returns:
List[str]: The name of the field to partition.
- static get_by_name(name: str) Strategy¶
Gets the partitioning strategy by name.
- Args:
name (str): The name of the partitioning strategy.
- Returns:
Strategy: The partitioning strategy.
- Raises:
IllegalArgumentException: If the name is invalid, this exception is thrown.
- name() str¶
Gets the transform function name.
- Returns:
str: The transform function name.
- references() List[NamedReference]¶
Returns a list of fields or columns that are referenced by this expression.
- strategy() Strategy¶
Returns the name of the partitioning strategy.
- Returns:
Strategy: The name of the partitioning strategy.
- validate(columns: List[ColumnDTO]) None¶
Validates the partitioning columns.
- Args:
columns (List[ColumnDTO]): The columns to be validated.
- Raises:
IllegalArgumentException: If the columns are invalid, this exception is thrown.
- width() int¶
Returns the width of the partitioning.
- Returns:
int: The width of the partitioning.