title: Executing a UDF in Pig only once
body: <p>I've seen this asked but I haven't seen an answer yet..</p>
  
  <p>Is it possible to call a UDF from pig just a single time?</p>
  
  <p>I basically want the transformation of a text file I store to handled by a single call to the java UDF. The internals of the transformation are easier to handle within Java, and the overhead is small, so I'd rather not convert the logic to pig..</p>
  
  <p>The only way i've successfully called a UDF is as part of a FOREACH statement over some dataset. I thought that I could just create a dummy tuple that was of size one, then use this as part of the 'foreach', but I can't figure out the syntax to create this dummy tuple either..</p>
  
  <p>The UDF does not need to return anything, it will handle the FS logic itself, I just want to be able to exec it from within the pig script as it makes more sense to instrument it here then as part of the greater workflow..</p>
  
  <p>Any help would be greatly appreciated!
  Thanks!</p>