|| at Feb 4, 2011 at 3:49 am
In pig 6, you can hook into bindTo() and save the file name.
In pig 8 you have to find your way to the underlying InputSplit via
PigSplit.getWrappedSplit(), cast it as FileSplit, and call getPath()
on it.. I think. Haven't done this.
This will totally break if you have splitCombination turned on, of
course, as pig can silently move to a different file under you, so
you'd have to turn that off.
On Thu, Feb 3, 2011 at 3:52 PM, Kim Vogt wrote:
I have a bunch of files where the filename is significant. I'm loading the
files by supplying the top level directory that contains the files. Is
there a way to capture the filename of the file and append to the tuple of
data that's in that file?