The COS Select feature uses Structured Query Language (SQL) statements to filter the objects stored in COS so as to extract specific objects and get desired data. With COS Select, you can reduce the amount of data transferred by COS for lower costs and latency during data extraction.
The COS Select feature currently allows you to extract objects stored in CSV, JSON, and Parquet formats and compressed by gzip or bzip2 (for CSV and JSON objects only). In addition, you can save extraction results in CSV and JSON formats and specify how to separate the result records.
You can pass in a SQL expression to COS in your request. COS Select currently only supports certain SQL expressions. For more information, see SQL Functions.
You can use the COS console, API, SDK, or COSCMD to perform SQL queries. Note that certain limits apply to file extraction in the COS console: up to 128 MB of files can be extracted, and up to 40 MB of data can be returned. To extract more data, you need to use other methods.
Note:
- For more information on data types supported by COS Select and current reserved fields, see Data Types and Reserved Fields.
- Currently, the extraction function only supports public cloud regions in the Chinese mainland.
The following restrictions apply to COS Select:
cos:GetObject
permission to the queried object. A root account has this permission by default.SQL clauses currently supported by COS Select include:
Note:For more information on SQL clauses, see SELECT Command.
Functions currently supported by COS Select include:
Note:For more information on SQL functions, see SQL Functions.
COS Select currently supports the following operators:
Note:For more information on operators, see Operators.
You can initiate an extraction request using the console, API, or SDK:
If a problem occurs when you perform a query, COS Select will return an error code and error message. For the list of error codes and descriptions, see Special Error Codes.
Apakah halaman ini membantu?