Query an object in S3 Glacier class

0 votes
I have stored an object in the S3 Glacier storage class. Now I wish to use the select query on it. How do I do that?
Oct 24, 2019 in AWS by Hannah
• 18,520 points
1,190 views

1 answer to this question.

0 votes

Hi @Hannah, 

1. Create a JSON file using the stored object parameter. Something like this:

{
    "Type": "SELECT",
    "Tier": "Standard",
    "SelectParameters": {
        "InputSerialization": {
            "CSV": {
                "FileHeaderInfo": "USE"
            }
        },
        "ExpressionType": "SQL",
        "Expression": "SELECT * FROM object",
        "OutputSerialization": {
            "CSV": {}
        }
    },
    "OutputLocation": {
        "S3": {
            "BucketName": "awsexamplebucket",
            "Prefix": "outputJob",
            "StorageClass": "STANDARD"
        }
    }
}

2. Run the restore-object  command 

$ aws s3api restore-object --bucket awsexamplebucket --key file.csv --restore-request file://restoreJob.json

3. You'll get your S3 object location. something like this:

{
    "RestoreOutputPath": "outputJob/example_iNHt-0sE2cqt8ZtwNdE1nHi7nKzRaIWLyzzcsW4QWIUaHduHVReDDdavy-aLfEdnD6ql3AR8s4f4oZzhdhBg/"
}

answered Oct 24, 2019 by Bob

Related Questions In AWS

0 votes
1 answer

How to upload an object into Amazon S3 in Lambda?

I suspect you are calling the context.done() function before s3.upload() has ...READ MORE

answered Sep 27, 2018 in AWS by Archana
• 4,170 points
1,192 views
0 votes
1 answer
0 votes
1 answer

How do I write an S3 Object to a file?

While IOUtils.copy() and IOUtils.copyLarge() are great, I would prefer the old ...READ MORE

answered Jul 13, 2018 in AWS by Hammer
• 360 points
4,637 views
+2 votes
1 answer

How to combine multiple S3 objects in the target S3 object w/o leaving S3

"However sometimes our raw objects are not ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 58,020 points
12,941 views
0 votes
1 answer
0 votes
1 answer

AWS s3 -trigger on object created, function gets invoked continuously

This is not supposed to happen. Please ...READ MORE

answered Feb 6, 2019 in AWS by Esha
694 views
+7 votes
2 answers

Why S3 is called a Object storage?

Amazon S3 stores data as objects within resources called "buckets".  Object storage, also ...READ MORE

answered Sep 24, 2018 in AWS by Priyaj
• 58,020 points
12,550 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP