On "getTextFiles" or "getFiles" call, there is second result available other than "file" called "filePath", that should give you the name of the file. You can project that out or use it in some other computations.
select x.filePath, x.file from ( exec getTextFiles("path/foo.txt) ) x
Thanks, that works! I've been using the 'flat file' wizard and just had to add the extra column...
- select colA, colB, ..., colX, f.filePath from ( exec getTextFiles("path/foo.txt) AS f, TEXTTABLES(...) ) x