Can I Add S3 File Name as a Column While Using Redshift COPY Command?

0
0
Asked By TechieTurtle42 On

I'm curious to know if there's a way to include the S3 key as a column in my Redshift table when using the COPY command. I've been unable to find a solution that does not require including the S3 key within the actual S3 file, which isn't always feasible. This limitation feels like a significant oversight. Are there any workarounds or suggestions?

1 Answer

Answered By DataGuru88 On

If you're using an external table that's backed by S3, you can simply add `$path` to your select statement to get the S3 file name. It automatically includes the path for you!

CuriousCoder12 -

I see, but I'm working with an actual S3 file, not an external table setup. This might not apply to my case.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.