Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . s3api ]

select-object-content

Description

This operation filters the contents of an Amazon S3 object based on a simple Structured Query Language (SQL) statement. In the request, along with the SQL expression, you must also specify a data serialization format (JSON or CSV) of the object. Amazon S3 uses this to parse object data into records, and returns only records that match the specified SQL expression. You must also specify the data serialization format for the response.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  select-object-content
--bucket <value>
--key <value>
[--sse-customer-algorithm <value>]
[--sse-customer-key <value>]
[--sse-customer-key-md5 <value>]
--expression <value>
--expression-type <value>
[--request-progress <value>]
--input-serialization <value>
--output-serialization <value>
[--scan-range <value>]
outfile <value>

Options

--bucket (string)

The S3 bucket.

--key (string)

The object key.

--sse-customer-algorithm (string)

The SSE Algorithm used to encrypt the object. For more information, see Server-Side Encryption (Using Customer-Provided Encryption Keys .

--sse-customer-key (string)

The SSE Customer Key. For more information, see Server-Side Encryption (Using Customer-Provided Encryption Keys .

--sse-customer-key-md5 (string)

The SSE Customer Key MD5. For more information, see Server-Side Encryption (Using Customer-Provided Encryption Keys .

--expression (string)

The expression that is used to query the object.

--expression-type (string)

The type of the provided expression (for example., SQL).

Possible values:

  • SQL

--request-progress (structure)

Specifies if periodic request progress information should be enabled.

Shorthand Syntax:

Enabled=boolean

JSON Syntax:

{
  "Enabled": true|false
}

--input-serialization (structure)

Describes the format of the data in the object that is being queried.

Shorthand Syntax:

CSV={FileHeaderInfo=string,Comments=string,QuoteEscapeCharacter=string,RecordDelimiter=string,FieldDelimiter=string,QuoteCharacter=string,AllowQuotedRecordDelimiter=boolean},CompressionType=string,JSON={Type=string},Parquet={}

JSON Syntax:

{
  "CSV": {
    "FileHeaderInfo": "USE"|"IGNORE"|"NONE",
    "Comments": "string",
    "QuoteEscapeCharacter": "string",
    "RecordDelimiter": "string",
    "FieldDelimiter": "string",
    "QuoteCharacter": "string",
    "AllowQuotedRecordDelimiter": true|false
  },
  "CompressionType": "NONE"|"GZIP"|"BZIP2",
  "JSON": {
    "Type": "DOCUMENT"|"LINES"
  },
  "Parquet": {

  }
}

--output-serialization (structure)

Describes the format of the data that you want Amazon S3 to return in response.

Shorthand Syntax:

CSV={QuoteFields=string,QuoteEscapeCharacter=string,RecordDelimiter=string,FieldDelimiter=string,QuoteCharacter=string},JSON={RecordDelimiter=string}

JSON Syntax:

{
  "CSV": {
    "QuoteFields": "ALWAYS"|"ASNEEDED",
    "QuoteEscapeCharacter": "string",
    "RecordDelimiter": "string",
    "FieldDelimiter": "string",
    "QuoteCharacter": "string"
  },
  "JSON": {
    "RecordDelimiter": "string"
  }
}

--scan-range (structure)

Specifies the byte range of the object to get the records from. A record is processed when its first byte is contained by the range. This parameter is optional, but when specified, it must not be empty. See RFC 2616, Section 14.35.1 about how to specify the start and end of the range.

Shorthand Syntax:

Start=long,End=long

JSON Syntax:

{
  "Start": long,
  "End": long
}

outfile (string) Filename where the records will be saved

See 'aws help' for descriptions of global parameters.

Output

This command generates no output. The selected object content is written to the specified outfile.