I am doing SUM on multiple column, those columns want to include in the SELECT list.
Below are my work:
val df=df0
.join(df1, df1("Col1")<=>df0("Col1"))
.filter((df1("Colum")==="00")
.groupBy(df1("Col1"),df1("Col1"))
.agg(sum(df1("Amount").alias("Amount1")),sum(df1("Amount2").alias("Amount2")))
.select(
df1("Col1").alias("co11"),
df1("Col2").alias("Col2"),
Amount1, Amount2 --getting error here
)
How to include the alias column in the SELECT list?