Databricks - Creating permanent User Defined Functions (UDFs)

后端 未结 2 983
谎友^
谎友^ 2021-01-17 00:17

I am able to create a UDF function and register to spark using spark.UDF method. However, this is per session only. How to register python UDF functions automatically when

2条回答
  •  一生所求
    2021-01-17 00:49

    This is not possible; this is not like UDFs in Hive.

    Code the UDF as part of the package / program you submit or in the jar included in the Spark App, if using spark-submit.

    However,

    spark.udf.register.udf("...
    

    is required to be done as well. This applies to Databrick notebooks, etc. The UDFs need to be re-registered per Spark Context/Session.

提交回复
热议问题