Skip to content

daft.functions.partition_iceberg_truncate#

partition_iceberg_truncate #

partition_iceberg_truncate(expr: Expression, w: int) -> Expression

Partitioning Transform that truncates the input to a standard width w following the Iceberg Specification.

See https://iceberg.apache.org/spec/#truncate-transform-details for more details.

Parameters:

Name Type Description Default
expr Expression

the expression to truncate

required
w int

width of the truncation

required

Returns:

Name Type Description
Expression Expression

Expression of the Same Type of the input

Source code in daft/functions/partition.py
61
62
63
64
65
66
67
68
69
70
71
72
73
def partition_iceberg_truncate(expr: Expression, w: int) -> Expression:
    """Partitioning Transform that truncates the input to a standard width `w` following the Iceberg Specification.

    See <https://iceberg.apache.org/spec/#truncate-transform-details> for more details.

    Args:
        expr: the expression to truncate
        w: width of the truncation

    Returns:
        Expression: Expression of the Same Type of the input
    """
    return Expression._from_pyexpr(expr._expr.partitioning_iceberg_truncate(w))