daft.Expression.binary.length

daft.Expression.binary.length#

Expression.binary.length() Expression[source]#

Retrieves the length for a binary string column.

Example

>>> import daft
>>> df = daft.from_pydict({"x": [b"foo", b"bar", b"baz"]})
>>> df = df.select(df["x"].binary.length())
>>> df.show()
╭────────╮
│ x      │
│ ---    │
│ UInt64 │
╞════════╡
│ 3      │
├╌╌╌╌╌╌╌╌┤
│ 3      │
├╌╌╌╌╌╌╌╌┤
│ 3      │
╰────────╯

(Showing first 3 of 3 rows)
Returns:

an UInt64 expression with the length of each binary string in bytes

Return type:

Expression