QuestionQ192
VerifiedTroubleshooting and Tuning Apache Spark DataFrame API Applications.A Spark developer wants to improve the performance of an existing PySpark UDF that executes a hash function unavailable in the standard Spark functions library.
The existing UDF code is:

The developer wants to replace the existing UDF with a Pandas UDF to improve performance.
The developer changes the definition of shake_256_udf to:
shake_256_udf = sf.pandas_udf(shake_256, StringType())
However, the developer receives this error:
[UNSUPPORTED_SIGNATURE] Unsupported signature: (raw: str) –> str.
To fix this error, what should the signature of the shake_256() function be changed to?
Community Discussion