Skip to content

redshift: no default id being assigned #24545

@Rizxcviii

Description

@Rizxcviii

Describe the bug

Upon the recent release, column ids were introduced, however the default value of the id is not set.
The id should be set to the name property, however this is not the case. The cdk diff does not show this.

Expected Behavior

Upon not setting an id in the Table construct.

[ ]   {
[ ]     "name": "col3",
[ ]     "dataType": "float",
[ ]     "comment": "A test column",
[-]     "encoding": "RAW"
[+]     "encoding": "RAW",
[+]     "id": "col3"
[ ]   }

Current Behavior

[ ]   {
[ ]     "name": "col3",
[ ]     "dataType": "float",
[ ]     "comment": "A test column",
[-]     "encoding": "RAW"
[+]     "encoding": "RAW",
[ ]   }

Reproduction Steps

Create a new table, without setting the id property of that table.

new redshift.Table(stack, 'Table', {
  ...databaseOptions,
  tableColumns: [
    { name: 'col1', dataType: 'varchar(4)' },
    { name: 'col2', dataType: 'float' },
    { name: 'col3', dataType: 'float' },
  ],
});

Possible Solution

Update the addColumnIds function to include the necessary functionality, which is a side effect to append on a column id if not present.

Additional Information/Context

This should have been implemented in the recent update, however this was overlooked.

CDK CLI Version

2.68.0

Framework Version

No response

Node.js Version

v16.16.0

OS

Amazon Linux 2

Language

Typescript, Python

Language Version

TypeScript (3.7.5) | 3.7.16

Other information

The PR that should have contained the fix is included here:
#24272

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-redshiftRelated to Amazon RedshiftbugThis issue is a bug.effort/mediumMedium work item – several days of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions