AWS AmazonS3 documentation change
Summary
Enhanced table creation documentation with partitioning support, including schema ID requirements and partition transform examples.
Security assessment
Changes focus on feature enhancement (partitioned tables) without security implications. No vulnerabilities, security controls, or encryption features are mentioned.
Diff
diff --git a/AmazonS3/latest/userguide/s3-tables-create.md b/AmazonS3/latest/userguide/s3-tables-create.md index 4d006e23f..8ac432af5 100644 --- a//AmazonS3/latest/userguide/s3-tables-create.md +++ b//AmazonS3/latest/userguide/s3-tables-create.md @@ -106 +106 @@ This example shows how to create a table with a schema by using the AWS CLI and -For the `mytabledefinition.json` file, use the following example table definition. To use this example, replace the ``user input placeholders`` with your own information. +For the `mytabledefinition.json` file, use the following example table definition. To create a partitioned table, include a `partitionSpec` in the table metadata. Each partition field references a column in your schema by its `sourceId` and applies a transform (such as `identity`, `bucket`, `truncate`, `year`, `month`, `day`, or `hour`) to produce the partition value. Because partition fields reference schema columns by ID, you must assign an explicit `id` to each field in your schema. The following example assigns IDs to the schema fields and partitions the table by the `registration_date` column using the `day` transform. To use this example, replace the ``user input placeholders`` with your own information. @@ -118,3 +118,9 @@ For the `mytabledefinition.json` file, use the following example table definitio - {"name": "id", "type": "int","required": true}, - {"name": "name", "type": "string"}, - {"name": "value", "type": "int"} + {"id": 1, "name": "id", "type": "int", "required": true}, + {"id": 2, "name": "name", "type": "string"}, + {"id": 3, "name": "registration_date", "type": "timestamp"} + ] + }, + "partitionSpec": { + "specId": 0, + "fields": [ + {"sourceId": 3, "transform": "day", "name": "registration_day"} @@ -129 +135 @@ You can create a table in a supported query engine that's connected to your tabl -The following example shows how to create a table with Spark by using `CREATE` statements, and add table data by using `INSERT` statements or by reading data from an existing file. To use this example, replace the ``user input placeholders`` with your own information. +The following example shows how to create a table with Spark by using `CREATE` statements, and add table data by using `INSERT` statements or by reading data from an existing file. To create a partitioned table, add a `PARTITIONED BY` clause to the `CREATE` statement. You can partition by one or more columns directly (identity partitioning) or by applying a partition transform such as `bucket`, `truncate`, `years`, `months`, `days`, or `hours`. The following example partitions the table by the `registration_date` column using the `days` transform. To use this example, replace the ``user input placeholders`` with your own information. @@ -136 +142 @@ The following example shows how to create a table with Spark by using `CREATE` s - value INT + registration_date TIMESTAMP @@ -138 +144,2 @@ The following example shows how to create a table with Spark by using `CREATE` s - USING iceberg " + USING iceberg + PARTITIONED BY (days(registration_date)) "