--

The following should do the trick:

```

import pyspark.sql.functions as sf

df = df.withColumn('mycol', sf.lit(True))

```

Hope it helps!

--

--

Giorgos Myrianthous
Giorgos Myrianthous

Written by Giorgos Myrianthous

I strive to build data-intensive systems that are not only functional, but also scalable, cost effective and maintainable over the long term.

Responses (1)