-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(redshift): Add support for distStyle, distKey, sortStyle and sortKey to Table #17135
Conversation
packages/@aws-cdk/aws-redshift/lib/private/database-query-provider/types.ts
Show resolved
Hide resolved
@njlynch Could you please help me address this error in the build?
The following seems to be related to aws/jsii#1818 and aws/jsii#1830 And I need to declare those enums in that particular folder only for the reason specified in the comment above. |
packages/@aws-cdk/aws-redshift/lib/private/database-query-provider/types.ts
Show resolved
Hide resolved
packages/@aws-cdk/aws-redshift/lib/private/database-query-provider/table.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
const oldTableColumns = oldResourceProperties.tableColumns; | ||
if (!oldTableColumns.every(oldColumn => tableColumns.some(column => column.name === oldColumn.name && column.dataType === oldColumn.dataType))) { | ||
return createTable(tableNamePrefix, tableNameSuffix, tableColumns, clusterProps); | ||
return createTable(tableNamePrefix, tableNameSuffix, tableColumns, tableAndClusterProps); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you educate me? What happens in this case? We have a table already with a name (e.g., MyTable) and we add a column. Then we execute a CREATE TABLE MyTable...
statement with a slightly different set of columns. Wouldn't that fail due to the table name already existing? I'm wondering the same about all of the other return createTable
calls further down this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the create table call would fail here in case the table needs replacing. The customer would then have a choice of manually dropping the table and/or updating the columns to avoid replacement.
packages/@aws-cdk/aws-redshift/lib/private/database-query-provider/table.ts
Outdated
Show resolved
Hide resolved
Pull request has been modified.
switch (newSortStyle) { | ||
case TableSortStyle.INTERLEAVED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome; can you add that as a comment here, just so its clear in-source?
packages/@aws-cdk/aws-redshift/lib/private/database-query-provider/table.ts
Show resolved
Hide resolved
packages/@aws-cdk/aws-redshift/lib/private/database-query-provider/index.ts
Outdated
Show resolved
Hide resolved
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…tKey to Table (aws#17135) feat(redshift): Add support for distStyle, distKey, sortStyle and sortKey to Table closes aws#17125 Ref: 1. https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html 2. https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
feat(redshift): Add support for distStyle, distKey, sortStyle and sortKey to Table
closes #17125
Ref:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license