left(value: string, length: int64) -> string

Returns the leftmost length Unicode characters of value. If value or length is null, the result is null. A negative length is clamped to zero, producing an empty string. When length exceeds the string length, the whole string is returned.

Domain

This is a scalar function (calculates a single output value for a single input row).

Categories

Examples

make_col short_id: left(trace_id, 8)

Takes the first eight Unicode characters from each trace identifier for compact display.