I am trying to create a SHA256 hash of each row in a dataframe.
import org.apache.spark.sql.functions.{col, concat, sha2}
val finalResultWithHash = finalResult.withColumn("ROWHASH", sha2(concat(finalResult.columns.map(col):_*), 256))
When I had only one column in the dataframe it seemed to be working.
Later in the code I write the dataframe as a CSV and the rowhash column is empty. I haven't been able to find any documentation on what I am doing wrong.
Thank you in advance.