class IcebergTransform
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.S3Tables.Alpha.IcebergTransform |
Java | software.amazon.awscdk.services.s3tables.alpha.IcebergTransform |
Python | aws_cdk.aws_s3tables_alpha.IcebergTransform |
TypeScript (source) | @aws-cdk/aws-s3tables-alpha ยป IcebergTransform |
Iceberg transform values for partition and sort fields.
Example
// 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',
},
],
},
},
});
Properties
| Name | Type | Description |
|---|---|---|
| value | string | The string value of the transform. |
| static DAY | Iceberg | Transform a timestamp/date field to day. |
| static HOUR | Iceberg | Transform a timestamp field to hour. |
| static IDENTITY | Iceberg | Use the column value as the transform value without transformation. |
| static MONTH | Iceberg | Transform a timestamp/date field to month. |
| static YEAR | Iceberg | Transform a timestamp/date field to year. |
value
Type:
string
The string value of the transform.
static DAY
Type:
Iceberg
Transform a timestamp/date field to day.
static HOUR
Type:
Iceberg
Transform a timestamp field to hour.
static IDENTITY
Type:
Iceberg
Use the column value as the transform value without transformation.
static MONTH
Type:
Iceberg
Transform a timestamp/date field to month.
static YEAR
Type:
Iceberg
Transform a timestamp/date field to year.
Methods
| Name | Description |
|---|---|
| to | Returns the string representation of the transform. |
| static bucket(n) | Transform values into a fixed number of buckets. |
| static of(value) | Create a custom transform from a string value. |
| static truncate(width) | Truncate values to a fixed width. |
toString()
public toString(): string
Returns
string
Returns the string representation of the transform.
static bucket(n)
public static bucket(n: number): IcebergTransform
Parameters
- n
numberโ The number of buckets (must be a positive integer).
Returns
Transform values into a fixed number of buckets.
static of(value)
public static of(value: string): IcebergTransform
Parameters
- value
stringโ The transform string value.
Returns
Create a custom transform from a string value.
static truncate(width)
public static truncate(width: number): IcebergTransform
Parameters
- width
numberโ The truncation width (must be a positive integer).
Returns
Truncate values to a fixed width.

.NET
Java
Python
TypeScript (