aws s3api select-object-content
This operation is not supported for directory buckets. AWS CLI reference
1 example 12 options Its page in the AWS CLI reference
Examples
To filter the contents of an Amazon S3 object based on an SQL statement
The following select-object-content example filters the object my-data-file.csv with the specified SQL statement and sends output to a file.
aws s3api select-object-content --bucket amzn-s3-demo-bucket --key my-data-file.csv --expression "select * from s3object limit 100" --expression-type 'SQL' --input-serialization '{"CSV": {}, "CompressionType": "NONE"}' --output-serialization '{"CSV": {}}' "output.csv"Identify--bucketThe S3 bucket.--keyThe object key.--expressionThe expression that is used to query the object.--expression-typeThe type of the provided expression (for example, SQL).--input-serializationDescribes the format of the data in the object that is being queried.--output-serializationDescribes the format of the data that you want Amazon S3 to return in response.This command produces no output.
For more information, see Querying data in place with Amazon S3 Select in the Amazon S3 User Guide.
Options
--bucketThe S3 bucket.--expected-bucket-ownerThe account ID of the expected bucket owner.--expression-typeThe type of the provided expression (for example, SQL).--expressionThe expression that is used to query the object.--input-serializationDescribes the format of the data in the object that is being queried.--keyThe object key.--output-serializationDescribes the format of the data that you want Amazon S3 to return in response.--request-progressSpecifies if periodic request progress information should be enabled.--scan-rangeSpecifies the byte range of the object to get the records from.--sse-customer-algorithmThe server-side encryption (SSE) algorithm used to encrypt the object.--sse-customer-key-md5The MD5 server-side encryption (SSE) customer managed key.--sse-customer-keyThe server-side encryption (SSE) customer managed key.