0

I am trying my hands on UDF in Impala. I have successfully developed a simple UDF. I want to try something different. My idea is to have a UDF which will take 3 different arguments. For e.g. String, double, int and these values which are received inside the UDF should be inserted into some table which already exists in Impala. Is this possible? If its possible then how this can be done?

Please guide me.

Manjunath Ballur
  • 6,287
  • 3
  • 37
  • 48
Mayank
  • 165
  • 1
  • 5
  • 20
  • The UDF shouldn't insert, it just operates on data. Can you give an example of what you want to do? – OneCricketeer Dec 28 '15 at 06:36
  • `IntVal SqrUdf(FunctionContext* context, const IntVal& arg1, const StringVal& arg2, const DoubleVal& arg3)` , this is the function it hould take this 3 values from the parameter and insert this into table which exists in impala, this is what I want to do. – Mayank Dec 28 '15 at 06:41
  • Again, a UDF *should not insert into the table*, an INSERT statement should. What exactly is your problem? Inserting data, or writing a UDF? – OneCricketeer Dec 28 '15 at 12:47

1 Answers1

0

Technically its possible, if your UDf is written in Java, this answer is usefull, your UDF will behave like any Impala Java client, but I dont recommand you to think this way, UDF is not to insert data, its to extend Impala to cover some very specefic cases.

Community
  • 1
  • 1
54l3d
  • 3,913
  • 4
  • 32
  • 58