Hello I am working with Scala, and I used somehing similar:
def play(col: Column): Column = {
concat_ws("", lit(imagePath), lit("/"), col("field1"), lit("/"), col("field2"), lit(".ext"))
}
val variable = spark.lot_of_stuff.
.withColumn("image_path", transform(col("column1.field1"), play(_)))