Ich möchte eine Spaltenliste von datframe
in eine Liste [Spalte] einfügen, damit ich eine Auswahlanforderung ausführen kann. es bedeutet, wollen Liste der Spalte bekommen und es automatisch in eine Liste einfügen [Spalte] Jede Hilfe DankSpaltenname in Liste [Spalte] anzeigen scala
object PCA extends App{
val spark = SparkSession.builder.master("local").appName("my-spark-app").getOrCreate()
val strPath="C:/Users/mhattabi/Desktop/testBis2.txt"
val intial_Data=spark.read.option("header",true).csv(strPath)
//array string contains names of column
val arrayList=intial_Data.columns
var colsList = List[Column]()
//wanna insert name of column into the listColum
arrayList.foreach(p=>colsList.)
//i want to have something like
//val colsList = List(col("col1"),col("col2"))
//intial_Data.select(colsList:_*).show
}