Skip to content

Instantly share code, notes, and snippets.

@meyarivan
Created October 31, 2014 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meyarivan/0851fcbcfb2e348050de to your computer and use it in GitHub Desktop.
Save meyarivan/0851fcbcfb2e348050de to your computer and use it in GitHub Desktop.
import os, sys
import org.apache.pig.tools.pigstats.PigStatusReporter as PigStatusReporter
import org.apache.pig.tools.counters.PigCounterHelper as PigCounterHelper
import org.apache.pig.impl.util.UDFContext as UDFContext
reporter = PigCounterHelper()
@outputSchema('modules:bag{t:tuple(filename:chararray,version:chararray,debug_file:chararray,debug_id:chararray,base_addr:chararray,max_addr:chararray)}')
def get_modules(strx):
retval = []
try:
for i in strx[0]:
retval.append((i['filename'], i['version'], i['debug_file'], i['debug_id'], i['base_addr'], i['end_addr']))
except:
reporter.incrCounter('stats', 'errors', 1)
return retval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment