code: def arrow_python_udf_example(spark: SparkSession) -> None:
      from pyspark.sql.functions import udf
  
      @udf(returnType="int")  # A default, pickled Python UDF
      def slen(s):  # type: ignore[no-untyped-def]
          return len(s)
  
      @udf(returnType="int", useArrow=True)  # An Arrow Python UDF
      def arrow_slen(s):  # type: ignore[no-untyped-def]
          return len(s)
  
      df = spark.createDataFrame(
          [(1, "John Doe", 21)], ("id", "name", "age")
      )
  
      df.select(slen("name"), arrow_slen("name")).show()
  
file_path: spark/examples/src/main/python/sql/arrow.py
imports: import pandas
  from typing import Iterable
  from pyspark.sql import SparkSession
  from pyspark.sql.pandas.utils import require_minimum_pandas_version, require_minimum_pyarrow_version
label_desc: Use image node_id 10 for calling a global function with example usage: arrow_python_udf_example(spark) and returns: len, len