I have a scenario where I need to load data from Amazon S3 into Amazong Redshift database.
The files in S3 are all JSON which reside under various folders in a bucket. Each folder indicates the date it was generated.
For instance, This is a sample folder structure in S3 :
- Bucket (B1)
A. Folder (F1)
i. file1.json, file2.json ... so on B. Folder (F2)
ii. file22.json, file23.json ... so on
Each of the JSON files do not have a single root element. They have the following format -
file1.json
{
Key : Value,
Key1 : [ some array],
Key2 : value3,
}
{
Key : Value1,
Key1 : [ some array1],
Key2 : value2,
}
I want to know if there is a way to load these data recursively (as the json resides in multiple folders) into redshift using copy command.
(OR)
if there is any better method to load the data apart from using copy command.