ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

服务 · Analytics · 基于 SAA-C03

Amazon Athena

Use CTAS and INSERT INTO to convert and partition data, with projection, workgroups and Iceberg.

本课尚未翻译,暂以英文显示。

你在Solutions Architect Associate中已学过

  • Athena is serverless SQL on S3 and you pay for data scanned.
  • Parquet, compression and partitions reduce the scan.
  • Workgroups separate teams, and federated queries reach other sources.
阅读Solutions Architect Associate课程
Raw CSV table
CTAS query
Partitioned Parquet
INSERT INTO
  1. 1A CTAS query reads the raw table.
  2. 2It writes partitioned Parquet to S3 and creates the new table.
  3. 3INSERT INTO appends new data to the same table.
CTAS builds the table and INSERT INTO adds data.
  • Partition projection

    What it does
    Computes partitions from rules
    Use it for
    Many date partitions
  • Workgroup

    What it does
    Limits data scanned
    Use it for
    Cost control per team
  • Iceberg table

    What it does
    ACID updates, time travel
    Use it for
    Data that changes
  • Federated query

    What it does
    Joins other sources
    Use it for
    S3 plus a database
Four Athena features for transform and control.

1 / 2

  • Partition projection

    What it does
    Computes partitions from rules
    Use it for
    Many date partitions
  • Workgroup

    What it does
    Limits data scanned
    Use it for
    Cost control per team
  • Iceberg table

    What it does
    ACID updates, time travel
    Use it for
    Data that changes

2 / 2

  • Federated query

    What it does
    Joins other sources
    Use it for
    S3 plus a database
Four Athena features for transform and control.

是什么

CREATE TABLE AS SELECT (CTAS) creates a new table from a query and writes the result to S3 in the format and layout you choose, for example Parquet with partitioned_by on a date column. That makes Athena a simple transform tool: convert CSV to Parquet, filter, join and partition in one statement. INSERT INTO adds more rows to an existing table. One CTAS or INSERT INTO writes at most 100 partitions, so split a bigger load into several statements.

是什么

Partition projection lets Athena compute partitions from rules in the table properties, such as a date range, rather than loading them from the catalog. Queries on tables with many partitions plan faster, and you do not need crawlers or partition repair. Workgroups set a results location, enforce encryption and cap data scanned per query or per workgroup; a query is billed for at least 10 MB. Federated queries use data source connectors to read other databases and join them with S3 data.

是什么

Apache Iceberg tables give Athena ACID transactions: UPDATE, DELETE and MERGE on data in S3, time travel to an earlier snapshot, and schema evolution. Use them for data that changes, such as a feature table that receives corrections.

要记住

  • CTAS: new table from a query, in the format and partitioning you set.
  • INSERT INTO appends. One statement writes up to 100 partitions.
  • Partition projection: no crawler or partition repair for regular partitions.
  • Workgroup limits cap data scanned. A query is billed for at least 10 MB.

要记住

  • Iceberg: UPDATE, DELETE, MERGE, time travel and schema evolution.

考试中

  • “Convert CSV in S3 to partitioned Parquet using only SQL” points to Athena CTAS.
  • “Thousands of date partitions slow query planning” points to partition projection.
  • “Fix individual rows in a data lake table” points to an Iceberg table.