daft.Expression.binary.concat

daft.Expression.binary.concat#

Expression.binary.concat(other: Expression) Expression[source]#

Concatenates two binary strings.

Example

>>> import daft
>>> df = daft.from_pydict(
...     {"a": [b"Hello", b"\\xff\\xfe", b"", b"World"], "b": [b" World", b"\\x00", b"empty", b"!"]}
... )
>>> df = df.select(df["a"].binary.concat(df["b"]))
>>> df.show()
╭────────────────────╮
│ a                  │
│ ---                │
│ Binary             │
╞════════════════════╡
│ b"Hello World"     │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ b"\\xff\\xfe\\x00" │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ b"empty"           │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ b"World!"          │
╰────────────────────╯

(Showing first 4 of 4 rows)
Parameters:

other – The binary string to concatenate with, can be either an Expression or a bytes literal

Returns:

A binary expression containing the concatenated strings

Return type:

Expression