QuestionQ282

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which UDF implementation computes the length of strings in a Spark DataFrame?

Explanation

Registering a Python function such as lambda s: len(s) with spark.udf.register creates a Spark SQL UDF that returns the length of each string passed to it.

Community Discussion

No comments yet. Be the first to start the discussion!