title: Alternative for df.withColumn in PySpark?
body: <p>I am converting some long datatype to datetime using withColumn and below code, but what I notice that when using withColumn inside for loops is leading to poor query planning performance.</p>
  <p>is there any other way I can achieve the below</p>
  <pre><code>from pyspark.sql import functions as F
  for col in list_of_columns:
      df = df.withColumn(col, F.from_utc_timestamp(F.from_unixtime(df[col] / 1000), &quot;UTC&quot;))
  list_of_columns = [list of 20 columns]
  </code></pre>