pyspark.sql.functions.
concat_ws
Concatenates multiple input string columns together into a single string column, using the given separator.
New in version 1.5.0.
Examples
>>> df = spark.createDataFrame([('abcd','123')], ['s', 'd']) >>> df.select(concat_ws('-', df.s, df.d).alias('s')).collect() [Row(s='abcd-123')]