2

In order to pass the entire row as an additional argument to Spark UDF in Scala I use struct("*"), for example:

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

How to do the same in PySpark?

1 Answer 1

4

One of the way to do it is

df.select(myUDF(f.struct(*list(df.columns)))) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.