Hi dear engineer,

I want to override the function open() in my UDF, like:




|
public class BlackListConvertFunction extends ScalarFunction {


    @Override
    public void open(FunctionContext context) throws Exception {
        String path = context.getJobParameter("black_list_path", 
"/config/list.properties");
        System.out.println(path);
    }


    public Double eval(String scores) {
        // some logics
        return 0.0;
    }
}


|






In open() function, I want to fetch the configred value "black_list_path", then 
simply print that value out. And I config this value in ./sql-client.sh console:


    SET black_list_path = /root/list.properties


Then I run this UDF, but what printed is /config/list.properties(this is the 
default value as I set in context.getJobParameter("black_list_path", 
"/config/list/properties")), not /root/list.properties which I set in 
./sql-client.sh console.


So could you please show me the correct way to set black_list_path is sql ? 
Thanks so much!




Thanks && Reards,
Hunk

Reply via email to