title: AWS Glue: How to add a column with the source filename in the output?
body: <p>Does anyone know of a way to add the source filename as a column in a Glue job?</p>
  
  <p>We created a flow where we crawled some files in S3 to create a schema. We then wrote a job that transforms the files to a new format, and the writes those files back to another S3 bucket as CSV, to be used by the rest of our pipeline. What we would like to do is get access to some sort of job meta properties so we can add a new column to the output file that contains the original filename. </p>
  
  <p>I looked through the AWS documentation and the aws-glue-libs source, but didn't see anything that jumped out. Ideally there would be some way to get metadata from the <code>awsglue.job</code> package (we're using the python flavor).</p>
  
  <p>I'm still learning Glue, so apologies if I'm using the wrong terminology. I tagged this with the spark tag as well, because I believe that's what Glue is using under the covers. </p>