sqlmeta.objects.partition
Table Partition SQL Model.
Classes
|
Represents a table partition. |
- class sqlmeta.objects.partition.Partition(name: str, table: str, partition_method: str, partition_expression: str | None = None, partition_description: str | None = None, subpartitions: List[Partition] | None = None, schema: str | None = None, dialect: str | None = None, **kwargs: Any)[source]
Represents a table partition.
- __init__(name: str, table: str, partition_method: str, partition_expression: str | None = None, partition_description: str | None = None, subpartitions: List[Partition] | None = None, schema: str | None = None, dialect: str | None = None, **kwargs: Any)[source]
Initialize a partition.
- Parameters:
name – Partition name
table – Table name this partition belongs to
partition_method – Partition method (RANGE, LIST, HASH, KEY)
partition_expression – Expression used for partitioning
partition_description – Partition boundary description (VALUES LESS THAN, VALUES IN, etc.)
subpartitions – List of subpartitions (for composite partitioning)
schema – Schema name (optional)
dialect – SQL dialect
**kwargs – Additional dialect-specific metadata
- property qualified_table_name: str
Get fully qualified table name.
- Returns:
Qualified table name (schema.table)
- property create_statement: str
Generate partition definition (part of ALTER TABLE or CREATE TABLE).
Note: Partitions are typically not created standalone, but as part of CREATE TABLE or ALTER TABLE statements.
- Returns:
Partition definition clause