Create a new UDF that is similar to "FirstTupleFromBag" but this one will be more general, and not only the first tuple.
This new UDF can be called "TupleFromBag" and will get three parameters:
3. Optional Default Tuple
There should be a consideration to refactor FirstTupleFromBag to call TupleFromBag, for reusability consideration.