Skip to content
v2.277.0

Experimental

@aws-cdk/aws-redshift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

TableSortStyle Enum ​

The sort style of a table.

Example ​

ts
new Table(this, 'Table', {
  tableColumns: [
    { name: 'col1', dataType: 'varchar(4)', sortKey: true },
    { name: 'col2', dataType: 'float', sortKey: true },
  ],
  cluster: cluster,
  databaseName: 'databaseName',
  sortStyle: TableSortStyle.COMPOUND,
});
python
from aws_cdk.aws_redshift_alpha import Column, Column
Table(self, "Table",
    table_columns=[Column(name="col1", data_type="varchar(4)", sort_key=True), Column(name="col2", data_type="float", sort_key=True)
    ],
    cluster=cluster,
    database_name="databaseName",
    sort_style=TableSortStyle.COMPOUND
)
java
Table.Builder.create(this, "Table")
        .tableColumns(List.of(Column.builder().name("col1").dataType("varchar(4)").sortKey(true).build(), Column.builder().name("col2").dataType("float").sortKey(true).build()))
        .cluster(cluster)
        .databaseName("databaseName")
        .sortStyle(TableSortStyle.COMPOUND)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Redshift.Alpha
new Table(this, "Table", new TableProps {
    TableColumns = new [] { new Column { Name = "col1", DataType = "varchar(4)", SortKey = true }, new Column { Name = "col2", DataType = "float", SortKey = true } },
    Cluster = cluster,
    DatabaseName = "databaseName",
    SortStyle = TableSortStyle.COMPOUND
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkredshiftalpha/v2
awscdkredshiftalpha.NewTable(this, jsii.String("Table"), &TableProps{
	TableColumns: []Column{
		&Column{
			Name: jsii.String("col1"),
			DataType: jsii.String("varchar(4)"),
			SortKey: jsii.Boolean(true),
		},
		&Column{
			Name: jsii.String("col2"),
			DataType: jsii.String("float"),
			SortKey: jsii.Boolean(true),
		},
	},
	Cluster: cluster,
	DatabaseName: jsii.String("databaseName"),
	SortStyle: awscdkredshiftalpha.TableSortStyle_COMPOUND,
})

Members ​

MemberDescription
AUTOAmazon Redshift assigns an optimal sort key based on the table data.
COMPOUNDSpecifies that the data is sorted using a compound key made up of all of the listed columns, in the order they are listed.
INTERLEAVEDSpecifies that the data is sorted using an interleaved sort key.

Referenced by ​

  • TableProps.sortStylesort_stylesortStyleSortStyleSortStyle