How to register persistent user-defined functions (UDFs) in SparkSQL

with sqlContext we can register the UDF as follows: sqlContext.udf.register("sample_fn", sample_fn _ ) But this UDF is limited only to a specific sqlContext. I want the registration to be permanent so that I can access the same UDF in any subsequent sqlcontext. Or is there another way to register UDFs in sparkSQL so that they remain constant?

+4
source share

All Articles