Apache spark 将整行作为附加参数传递给PySpark中的UDF

Apache spark 将整行作为附加参数传递给PySpark中的UDF,apache-spark,pyspark,apache-spark-sql,Apache Spark,Pyspark,Apache Spark Sql,为了将整行作为附加参数传递给Scala中的Spark UDF,我使用struct(“*”),例如: df.select(myUDF($"name",struct("*"))) 如何在PySpark中执行相同的操作?其中一种方法是 df.select(myUDF(f.struct(*list(df.columns))))

为了将整行作为附加参数传递给Scala中的Spark UDF,我使用
struct(“*”)
,例如:

df.select(myUDF($"name",struct("*")))

如何在PySpark中执行相同的操作?

其中一种方法是

df.select(myUDF(f.struct(*list(df.columns))))