maxframe.liteframe.LiteFrame.rebalance#
- LiteFrame.rebalance(axis=0, factor=None, num_partitions=None, rough=False)#
Make data more balanced across entire cluster.
LiteFrame is only ever chunked along the row axis (axis 0);
axisis accepted for API parity withDataFrame.rebalancebut should remain 0.- Parameters:
axis (int) – The axis to rebalance.
factor (float) – Specified so the number of chunks after balance along the selected axis per plane is
chunk_shape[axis] * factor.num_partitions (int) – Specified so the number of chunks are at most num_partitions.
rough (bool, default False) –
Hint to rebalance without first resolving unknown row shapes.
When True, rebalance may partition the row axis using a per-chunk size estimate (
rough_size_ratio) instead of waiting for real (resolved) shapes. This only has an effect when the row shape is unknown and the source chunks carry such an estimate; currently that estimate is produced only by SIZE-moderead_odps_tablereads. In every other case – known shapes, or an unknown row axis with no estimate –rough=Truesilently falls back to the normal path (resolving real shapes then rechunking). The estimate is approximate, so the output is balanced by estimated share, not exactly equal in size.
- Returns:
Result of LiteFrame after rebalanced.
- Return type: