Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions packages/@aws-cdk/aws-s3tables-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,82 @@ const sampleTableWithSchema = new Table(scope, 'ExampleSchemaTable', {

Learn more about table buckets maintenance operations and default behavior from the [S3 Tables User Guide](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-table-buckets-maintenance.html)

### Advanced Iceberg Table Configuration

You can configure partition specifications, sort orders, and table properties for optimized query performance.

The simplest way to add partitioning to your table:

```ts
// Build a table with partition spec (minimal configuration)
const partitionedTable = new Table(scope, 'PartitionedTable', {
tableName: 'partitioned_table',
namespace: namespace,
openTableFormat: OpenTableFormat.ICEBERG,
icebergMetadata: {
icebergSchema: {
schemaFieldList: [
{ name: 'event_date', type: 'date', required: true },
{ name: 'event_name', type: 'string' },
],
},
icebergPartitionSpec: {
fields: [
{
sourceId: 1,
transform: IcebergTransform.IDENTITY,
name: 'date_partition',
},
],
},
},
});
```

For full control, you can also configure sort orders and table properties:

```ts
// Build a table with partition spec, sort order, and table properties
const advancedTable = new Table(scope, 'AdvancedTable', {
tableName: 'advanced_table',
namespace: namespace,
openTableFormat: OpenTableFormat.ICEBERG,
icebergMetadata: {
icebergSchema: {
schemaFieldList: [
{ id: 1, name: 'event_date', type: 'date', required: true },
{ id: 2, name: 'user_id', type: 'string', required: true },
],
},
icebergPartitionSpec: {
specId: 0,
fields: [
{
sourceId: 1,
transform: IcebergTransform.IDENTITY,
name: 'date_partition',
fieldId: 1000,
},
],
},
icebergSortOrder: {
orderId: 1,
fields: [
{
sourceId: 1,
transform: IcebergTransform.IDENTITY,
direction: SortDirection.ASC,
nullOrder: NullOrder.NULLS_LAST,
},
],
},
tableProperties: [
{ key: 'write.format.default', value: 'parquet' },
],
},
});
```

### Controlling Table Bucket Permissions

```ts
Expand Down
Loading
Loading