pyspark.sql.functions.lit

pyspark.sql.functions.lit(col: Any) → pyspark.sql.column.Column

Creates a Column of literal value.

Examples

>>> df.select(lit(5).alias('height')).withColumn('spark_user', lit(True)).take(1)
[Row(height=5, spark_user=True)]