Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution

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

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

Accepted Solutions

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

Master Collaborator

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.

2 REPLIES 2

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

Master Collaborator

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

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

Explorer

thanks for the solution, It works!!