How many elements do you have in the Bag? Can you hold the elements in a Tuple instead of a Bag?
-Prashant On Mon, Dec 12, 2011 at 7:54 PM, 唐亮 <[email protected]> wrote: > Hi all, > How can I implement a binary search in pig? > > In one relation, there exists a bag whose items are sorted. > And I want to check there exists a specific item in the bag. > > In UDF, I can't random access items in DataBag container. > So I have to transfer the items in DataBag to an ArrayList, and this is > time consuming. > > How can I implement the binary search efficiently in pig? >
