code: def main():
      with SparkSession.builder.getOrCreate() as spark:
          df = spark.createDataFrame(
              [
                  (
                      "a",
                      [0],
                      {"bool": True},
                      [{"double": 0.1}],
                  )
              ],
              schema=T.StructType(
                  [
                      T.StructField(
                          "str",
                          T.StringType(),
                      ),
                      T.StructField(
                          "arr",
                          T.ArrayType(T.IntegerType()),
                      ),
                      T.StructField(
                          "obj",
                          T.StructType(
                              [
                                  T.StructField(
                                      "bool", T.BooleanType()
                                  ),
                              ]
                          ),
                      ),
                      T.StructField(
                          "obj_arr",
                          T.ArrayType(
                              T.StructType(
                                  [
                                      T.StructField(
                                          "double", T.DoubleType()
                                      ),
                                  ]
                              )
                          ),
                      ),
                  ]
              ),
          )
          df.printSchema()
          df.show()
  
          with mlflow.start_run():
              model_info = mlflow.pyfunc.log_model(
                  artifact_path="model",
                  python_model=MyModel(),
                  signature=mlflow.models.infer_signature(df),
              )
  
          udf = mlflow.pyfunc.spark_udf(
              spark=spark,
              model_uri=model_info.model_uri,
              result_type="string",
          )
          df.withColumn(
              "output", udf("str", "arr", "obj", "obj_arr")
          ).show()
  
imports: from pyspark.sql import SparkSession
  from pyspark.sql import types
  import mlflow
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types