-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I failed to create a JS UDF with the native JDBC driver
CREATE OR REPLACE FUNCTION bug1(arg0 string) RETURNS string LANGUAGE JAVASCRIPT AS $$
function _whois(ip){
switch(ip){
case '1.2.3.4': return 'Someone @ ACME';
default: return 'Unknown';
}
}
function bug1(ips){
for(let i=0;i<ips.length;i++) {
ips[i]=_whois(ips[i]);
}
return ips;
}
$$;
Error:
DB::ExceptionDB::Exception: the JavaScript UDF bug1 is invalid. Detail error: Uncaught SyntaxError: Unexpected token ')'. Stack trace:

But the same SQL can be run in web console

Metadata
Metadata
Assignees
Labels
No labels