Is this possible in spark-scala? I am using spark 2.2
val func="""withColumn("seq", lit("this is seq"))
.withColumn("id", lit("this is id"))
.withColumn("type", lit("this is type"))"""
Then use the above variable on top of a dataframe (df) like this
val df2=df.$func
Reason I am saving those functions to a variable is that I want to apply functions dynamically based on conditions. Sometime I may want 1 withColumn and sometimes I may want multiple withColumn functions.
Appreciate any help. Thanks!