Reply
Explorer
Posts: 8
Registered: ‎01-22-2017
Accepted Solution

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

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 ?

Cloudera Employee
Posts: 437
Registered: ‎07-29-2015

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

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.

Highlighted
Explorer
Posts: 8
Registered: ‎01-22-2017

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

thanks for the solution, It works!!