View a markdown version of this page

How PutRows works - Amazon Simple Storage Service

How PutRows works

PutRows accepts a request that contains one or more rows, validates every row against the table's current Apache Iceberg schema, and accepts the rows for ingestion. S3 Tables then durably buffer the accepted rows from every producer that writes to the table, write them into Parquet data files, and commit a new Iceberg snapshot that makes them queryable.

How data is written

  1. A producer sends rows in a PutRows request.

  2. PutRows validates every row against the table's current schema. If any row is invalid, PutRows rejects the whole request.

  3. PutRows durably stores accepted rows.

  4. S3 Tables combine the accepted rows from all producers and write them into Parquet files.

  5. S3 Tables commit the Parquet files to the table, and the rows are queryable from this point.

Channels

To ingest data into a table, you send your rows to a channel. Every table has a default channel, named default. The default channel is created the first time that PutRows writes to the table. To check the channel's health, call GetChannel with the table ARN. GetChannel returns the channel's state and the approximate number of rows accepted but not yet committed. If S3 Tables can't commit rows for a reason that you can fix, GetChannel also returns an error code and message.

Other writers

Other engines, such as Amazon Athena and Amazon EMR, can write to a table while PutRows writes to it, by using standard Iceberg commits through the S3 Tables Iceberg REST endpoint.

Schema changes

You can change a table's schema while PutRows writes to it. To protect rows that PutRows has already accepted but not yet committed, S3 Tables commit those rows before a schema change takes effect. While rows are buffered, S3 Tables block schema changes while the table has accepted rows that aren't committed yet, so that those rows can be committed against the schema that they were validated against.

After a change, PutRows recognizes the new schema within a few seconds. PutRows might temporarily validate and commit some requests against the old schema during this time.

For more information on compatible schema changes, see Best practices, monitoring, and troubleshooting PutRows.

Table maintenance

You can configure maintenance operations on any table with a PutRows channel, and creating a channel does not affect your maintenance configuration on that table. PutRows writes files sized to the table's target file size where possible. S3 Tables manages each table's target file size. The default is 512 MB, and you can set it from 64 MB to 512 MB with PutTableMaintenanceConfiguration. PutRows and compaction use the same target file size. For tables with low write volume, compaction combines the smaller files that S3 Tables commit on each interval.