Repartitioners
Module with repartitioners transformers.
Repartitioners
¶
Bases: object
Class containing repartitioners transformers.
Source code in mkdocs/lakehouse_engine/packages/transformers/repartitioners.py
coalesce(num_partitions)
classmethod
¶
Coalesce a dataframe into n partitions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_partitions |
int
|
num of partitions to coalesce. |
required |
Returns:
Type | Description |
---|---|
Callable
|
A function to be called in .transform() spark function. |
View Example of coalesce (See full example here)
Source code in mkdocs/lakehouse_engine/packages/transformers/repartitioners.py
repartition(num_partitions=None, cols=None)
classmethod
¶
Repartition a dataframe into n partitions.
If num_partitions is provided repartitioning happens based on the provided number, otherwise it happens based on the values of the provided cols (columns).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_partitions |
Optional[int]
|
num of partitions to repartition. |
None
|
cols |
Optional[List[str]]
|
list of columns to use for repartitioning. |
None
|
Returns:
Type | Description |
---|---|
Callable
|
A function to be called in .transform() spark function. |