Skip to content

feat(s3tables-alpha): add support for partition spec, sort order, and table properties#36811

Merged
mergify[bot] merged 13 commits intoaws:mainfrom
olenarostotskyy:olrostob/s3tables-new-features
Mar 19, 2026
Merged

feat(s3tables-alpha): add support for partition spec, sort order, and table properties#36811
mergify[bot] merged 13 commits intoaws:mainfrom
olenarostotskyy:olrostob/s3tables-new-features

Conversation

@olenarostotskyy
Copy link
Copy Markdown
Contributor

@olenarostotskyy olenarostotskyy commented Jan 28, 2026

Reason for this change

This PR adds support for new S3 Tables Iceberg features to the L2 construct library, enabling users to configure partition specifications, sort orders, table properties, and schema field IDs when creating tables.

These features are essential for optimizing query performance and data organization in Iceberg tables.

Description of changes

Enhanced Table construct with new Iceberg metadata properties:

  • Added id field to SchemaFieldProperty for schema field identification
  • Added IcebergPartitionSpec and IcebergPartitionField interfaces for partition configuration
  • Added IcebergSortOrder and IcebergSortField interfaces for sort order configuration
  • Added tableProperties support for custom Iceberg table properties
  • Updated IcebergMetadataProperty to include optional icebergPartitionSpec, icebergSortOrder, and tableProperties

Documentation:

  • Added comprehensive examples for IcebergPartitionField, IcebergPartitionSpec, and IcebergSortOrder
  • Updated README with "Advanced Iceberg Table Configuration" section showing complete usage examples

Description of how you validated changes

  • Unit tests: Added comprehensive test coverage for new features (192 tests passing)
  • Integration test: Created integ.table-with-partition-sort.ts to validate partition spec, sort order, and table properties
  • Manual testing: Successfully deployed and validated in Gamma environment where the CloudFormation resource type with new properties is available. Verified that partition spec, sort order, and table properties are correctly applied to the Iceberg table metadata.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team January 28, 2026 22:37
@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Jan 28, 2026
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@olenarostotskyy olenarostotskyy changed the title Olrostob/s3tables new features Olrostob/s3tables new features #36811 Jan 28, 2026
@olenarostotskyy olenarostotskyy changed the title Olrostob/s3tables new features #36811 feat(s3tables-alpha): add support for partition spec, sort order, and table properties Jan 28, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review February 12, 2026 06:54

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@olenarostotskyy olenarostotskyy marked this pull request as ready for review February 12, 2026 07:02
@arthi-agrawal arthi-agrawal mentioned this pull request Feb 14, 2026
2 tasks
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results96 ran96 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates96 ran96 passed
TestResult
No test annotations available

Copy link
Copy Markdown
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Build is failing, could you make CI/CD working so it is passing?

Copy link
Copy Markdown
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments regarding design

Comment on lines +294 to +297
/**
* The partition transform function (e.g., 'identity', 'day', 'hour', 'bucket', 'truncate').
*/
readonly transform: string;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this an enum? Is this values are defined, maybe can do?

export enum PartitionTransform {
  IDENTITY = 'identity',
  YEAR = 'year',
  MONTH = 'month',
  DAY = 'day',
  HOUR = 'hour',
  BUCKET = 'bucket',
  TRUNCATE = 'truncate',
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this to use a PartitionTransform enum.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still using string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you address this comment? IcebergTransform is an enum-like class so it can be used here instead string

/**
* The sort direction.
*/
readonly direction: 'asc' | 'desc';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to define this as enum as well:

export enum SortDirection {
  ASC = 'asc',
  DESC = 'desc',
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or could we make this just as boolean, if it has only two fields:

readonly ascending: boolean;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this to use a SortDirection enum instead of string literals.
I kept this as an enum rather than a boolean so the API stays explicit and matches the underlying Iceberg/CFN value shape.

Comment on lines +662 to +663
// Use addPropertyOverride for properties not yet in L1 types
// Override schema to include Id field
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still valid, as now L1 resources are published, do you need to still override?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not please update all overrides below to use L1 values

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the overrides.

Comment on lines +346 to +354
/**
* The sort direction.
*/
readonly direction: 'asc' | 'desc';

/**
* The null ordering.
*/
readonly nullOrder: 'nulls-first' | 'nulls-last';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments apply here as above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

/**
* Test for table with partition spec, sort order, and table properties
*/
class TableWithPartitionSortStack extends core.Stack {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extending core.Stack is not recommend pattern, use following pattern

import { App, Stack } from 'aws-cdk-lib'; // import this
class TestStack extends Stack { // update here
}
const app = new App(); // Need changes below 

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this test to use App and Stack from aws-cdk-lib directly.

}
}

const app = new core.App();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this test to use App and Stack from aws-cdk-lib directly, consistent with the other integration test.

@olenarostotskyy olenarostotskyy force-pushed the olrostob/s3tables-new-features branch from dd5c4db to f0fa696 Compare March 19, 2026 03:29
@mergify mergify bot dismissed ozelalisen’s stale review March 19, 2026 03:29

Pull request has been modified.

@ozelalisen ozelalisen added the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Mar 19, 2026
@ozelalisen ozelalisen temporarily deployed to deployment-integ-test March 19, 2026 10:07 — with GitHub Actions Inactive
@ozelalisen ozelalisen removed the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Mar 19, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Merge Queue Status

  • Entered queue2026-03-19 17:36 UTC · Rule: default-squash
  • Checks passed · in-place
  • Merged2026-03-19 22:39 UTC · at 27d9ebc60ddb1a004070c2ccc7c55514ae127c35

This pull request spent 5 hours 3 minutes 14 seconds in the queue, including 2 hours 27 minutes 43 seconds running CI.

Required conditions to merge

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 2696cd1 into aws:main Mar 19, 2026
23 of 24 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants