class_docstr: Wrapper for user-defined table function registration. This instance can be accessed by
  :attr:`spark.udtf` or :attr:`sqlContext.udtf`.
  
  .. versionadded:: 3.5.0
class_docstr_tok: ["Wrapper","for","user-defined","table","function","registration",".","This","instance","can","be","accessed","by",":","attr",":","`","spark.udtf","`","or",":","attr",":","`","sqlContext.udtf","`",".","..","versionadded",":",":","3.5.0"]
docstr: Register a Python user-defined table function as a SQL table function.
  
  .. versionadded:: 3.5.0
  
  Parameters
  ----------
  name : str
      The name of the user-defined table function in SQL statements.
  f : function or :meth:`pyspark.sql.functions.udtf`
      The user-defined table function.
  
  Returns
  -------
  function
      The registered user-defined table function.
  
  Notes
  -----
  Spark uses the return type of the given user-defined table function as the return
  type of the registered user-defined function.
  
  To register a nondeterministic Python table function, users need to first build
  a nondeterministic user-defined table function and then register it as a SQL function.
  
  Examples
  --------
  >>> from pyspark.sql.functions import udtf
  >>> @udtf(returnType="c1: int, c2: int")
  ... class PlusOne:
  ...     def eval(self, x: int):
  ...         yield x, x + 1
  ...
  >>> _ = spark.udtf.register(name="plus_one", f=PlusOne)
  >>> spark.sql("SELECT * FROM plus_one(1)").collect()
  [Row(c1=1, c2=2)]
  
  Use it with lateral join
  
  >>> spark.sql("SELECT * FROM VALUES (0, 1), (1, 2) t(x, y), LATERAL plus_one(x)").collect()
  [Row(x=0, y=1, c1=0, c2=1), Row(x=1, y=2, c1=1, c2=2)]
docstr_tok: ["Register","a","Python","user-defined","table","function","as","a","SQL","table","function",".","..","versionadded",":",":","3.5.0","Parameters","--","--","--","--","--","name",":","str","The","name","of","the","user-defined","table","function","in","SQL","statements",".","f",":","function","or",":","meth",":","`","pyspark.sql.functions.udtf","`","The","user-defined","table","function",".","Returns","--","--","--","-","function","The","registered","user-defined","table","function",".","Notes","--","--","-","Spark","uses","the","return","type","of","the","given","user-defined","table","function","as","the","return","type","of","the","registered","user-defined","function",".","To","register","a","nondeterministic","Python","table","function",",","users","need","to","first","build","a","nondeterministic","user-defined","table","function","and","then","register","it","as","a","SQL","function",".","Examples","--","--","--","--",">",">",">","from","pyspark.sql.functions","import","udtf",">",">",">","@","udtf","(","returnType=","''","c1",":","int",",","c2",":","int","''",")","...","class","PlusOne",":","...","def","eval","(","self",",","x",":","int",")",":","...","yield","x",",","x","+","1","...",">",">",">","_","=","spark.udtf.register","(","name=","''","plus_one","''",",","f=PlusOne",")",">",">",">","spark.sql","(","``","SELECT","*","FROM","plus_one","(","1",")","''",")",".collect","(",")","[","Row","(","c1=1",",","c2=2",")","]","Use","it","with","lateral","join",">",">",">","spark.sql","(","``","SELECT","*","FROM","VALUES","(","0",",","1",")",",","(","1",",","2",")","t","(","x",",","y",")",",","LATERAL","plus_one","(","x",")","''",")",".collect","(",")","[","Row","(","x=0",",","y=1",",","c1=0",",","c2=1",")",",","Row","(","x=1",",","y=2",",","c1=1",",","c2=2",")","]"]
code: def register(
      self,
      name: str,
      f: "UserDefinedTableFunction",
  ) -> "UserDefinedTableFunction":
      """Register a Python user-defined table function as a SQL table function.
  
      .. versionadded:: 3.5.0
  
      Parameters
      ----------
      name : str
          The name of the user-defined table function in SQL statements.
      f : function or :meth:`pyspark.sql.functions.udtf`
          The user-defined table function.
  
      Returns
      -------
      function
          The registered user-defined table function.
  
      Notes
      -----
      Spark uses the return type of the given user-defined table function as the return
      type of the registered user-defined function.
  
      To register a nondeterministic Python table function, users need to first build
      a nondeterministic user-defined table function and then register it as a SQL function.
  
      Examples
      --------
      >>> from pyspark.sql.functions import udtf
      >>> @udtf(returnType="c1: int, c2: int")
      ... class PlusOne:
      ...     def eval(self, x: int):
      ...         yield x, x + 1
      ...
      >>> _ = spark.udtf.register(name="plus_one", f=PlusOne)
      >>> spark.sql("SELECT * FROM plus_one(1)").collect()
      [Row(c1=1, c2=2)]
  
      Use it with lateral join
  
      >>> spark.sql("SELECT * FROM VALUES (0, 1), (1, 2) t(x, y), LATERAL plus_one(x)").collect()
      [Row(x=0, y=1, c1=0, c2=1), Row(x=1, y=2, c1=1, c2=2)]
      """
      if f.evalType not in [
          PythonEvalType.SQL_TABLE_UDF,
          PythonEvalType.SQL_ARROW_TABLE_UDF,
      ]:
          raise PySparkTypeError(
              error_class="INVALID_UDTF_EVAL_TYPE",
              message_parameters={
                  "name": name,
                  "eval_type": "SQL_TABLE_UDF, SQL_ARROW_TABLE_UDF",
              },
          )
  
      register_udtf = _create_udtf(
          cls=f.func,
          returnType=f.returnType,
          name=name,
          evalType=f.evalType,
          deterministic=f.deterministic,
      )
      self.sparkSession._jsparkSession.udtf().registerPython(
          name, register_udtf._judtf
      )
      return register_udtf
  
imports: import pickle
  from dataclasses import dataclass, field
  import inspect
  import sys
  import warnings
  from typing import Any, Type, TYPE_CHECKING, Optional, Sequence, Union
  from py4j.java_gateway import JavaObject
  from pyspark.errors import PySparkAttributeError, PySparkPicklingError, PySparkTypeError
  from pyspark.rdd import PythonEvalType
  from pyspark.sql.column import _to_java_column, _to_java_expr, _to_seq
  from pyspark.sql.pandas.utils import require_minimum_pandas_version, require_minimum_pyarrow_version
  from pyspark.sql.types import DataType, StructType, _parse_datatype_string
  from pyspark.sql.udf import _wrap_function
label_desc: Use image node_id 2 for calling the UDTFRegistration obj's underlying member method code with example usage: obj.register(name, f) and returns: register_udtf