How to read the file name alongwith the file contents using S3 Load Component in Matillion for Snowflake. I am able to read the JSON file contenets, but I also need to read the file name, so that I can store both the filename and the file contents

How to read the file name alongwith the file contents using S3 Load Component in Matillion for Snowflake.

I am able to read the JSON file contenets, but I also need to read the file name, so that I can store both the filename and the file contents.

Hi @samantaray.subir​,

You can leverage the Snowflake metadata fields for this. A simple example would be to have a table that has 3 columns ( 1 variant column for the json file contents, 1 string column for the full file path, and 1 for the load timestamp). When the S3 Load component executes it will execute a COPY INTO statement and provide the json data, filename, and current timestamp. Here is an example of the configuration of the S3 Load component:

Thanks for the detail screenshot !