So if I don't want to restart the cluster, do you think the versionized jar name and class name would be a better solution?
At first, I used this command to create the original UDF:
create or replace temporary function test_udf as 'com.example.TestUDF_v1' using jar '/tmp/test_udf_v1.jar';
Then I want to update the UDF, I'll try that:
create or replace temporary function test_udf as 'com.example.TestUDF_v2' using jar '/tmp/test_udf_v2.jar';
But that may be into another problem, if different jars have the same class name like 'com.example.SameClass', which version of class will spark cluster use eventually without restart?