The IN UDF is a special one in that unlike many others there is support in the ANTLR language and parsers for it. The rough answer is it can be done but it is not as direct as making other UDFs.

On Tue, Mar 8, 2016 at 2:32 PM, Lavelle, Shawn <> wrote:

Hello All,

   I hope that this question isn’t too rudimentary – but I’m relatively new to HIVE.


   In Hive 0.11, I’ve written a UDF that returns a list of Integers. I’d like to use this in a WHERE clause of a query, something like SELECT * FROM <table> WHERE <col>  in ( getList() ). (Extra parenthesis needed to pass the parser.)  Is such a thing possible?  Keying in values for the list parameter works, but they have WritableConstantIntObjectInspectors whereas what is returned by my list (despite my best efforts) has an element inspector of WritabeIntObjectInspector. This doesn’t work. 

  So, two questions – Should It? (The HIVE I’m working on is heavily modified :/ ) and how might I accomplish this?  Joins would be ideal, but we haven’t upgraded yet.

  Thank you for your insight,


~ Shawn M Lavelle


Shawn Lavelle
Software Development

4101 Arrowhead Drive
Medina, Minnesota 55340-9457
Phone: 763 551 0559
Fax: 763 551 0750