Skip to content

daft.functions.extract_minute_uuid7#

extract_minute_uuid7 #

extract_minute_uuid7(expr: Expression) -> Expression

Partitioning Transform that extracts the number of minutes since epoch (1970-01-01) from a UUIDv7.

A UUIDv7 embeds a 48-bit Unix-millisecond timestamp in its first 6 bytes. The input must be a Uuid or a FixedSizeBinary of 16 bytes (128 bits).

Parameters:

Name Type Description Default
expr Expression

a Uuid or FixedSizeBinary(16) expression of UUIDv7 values

required

Returns:

Name Type Description
Expression Expression

Int64 Expression with the number of minutes since epoch

Source code in daft/functions/partition.py
76
77
78
79
80
81
82
83
84
85
86
87
88
def extract_minute_uuid7(expr: Expression) -> Expression:
    """Partitioning Transform that extracts the number of minutes since epoch (1970-01-01) from a UUIDv7.

    A UUIDv7 embeds a 48-bit Unix-millisecond timestamp in its first 6 bytes. The input must be a
    Uuid or a FixedSizeBinary of 16 bytes (128 bits).

    Args:
        expr: a Uuid or FixedSizeBinary(16) expression of UUIDv7 values

    Returns:
        Expression: Int64 Expression with the number of minutes since epoch
    """
    return Expression._call_builtin_scalar_fn("extract_minute_uuid7", expr)