Support Questions

Find answers, ask questions, and share your expertise

How to create impala UDF common to all database instead select one by one?

avatar
Explorer

I've more than one database in impala, I want to create UDF in c++ which will be common to all databases similar to build in functions. Is there is any way to avoid creating same functions in each databse?

if I've two database DB1 and DB2 and I want to add a UDF to_upper_case() in each of these, I need to select each database by using USE <database_name> command and then I've add UDF in each.

is there any way to create to_upper_case() UDF such that it will be common for DB1 and DB2 ?

1 ACCEPTED SOLUTION

avatar

Hi Akhil,

  The only way I can think of to achieve this is to refer the udf by its fully-qualified name. E.g. if you create a function "my_fn" in a database "my_db" you can call it as my_db.my_fn() from any database.

View solution in original post

2 REPLIES 2

avatar

Hi Akhil,

  The only way I can think of to achieve this is to refer the udf by its fully-qualified name. E.g. if you create a function "my_fn" in a database "my_db" you can call it as my_db.my_fn() from any database.

avatar
Explorer

thanks for the solution, It works!!