-
Notifications
You must be signed in to change notification settings - Fork 4k
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
AWS CDK - Unable to delete a column of table from redshift database using CDK update) #22208
Comments
I've been able to reproduce this, thanks for reporting @gurukarn We'll probably need to update our logic in the aws-cdk/packages/@aws-cdk/aws-redshift/lib/private/database-query-provider/table.ts Line 70 in 40ddfdd
|
I have made a PR for this change to be implemented. Just need to wait for a review. @comcalvi or @peterwoodworth would it be possible to review this at your earliest convenience? |
) When attempting to a drop a column from the array, this would cause an error similar to that of the following ```Received response status [FAILED] from custom resource. Message returned: Statement status was FAILED: ERROR: column "column" of relation "table” already exists``` fixes #22208 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…#23011) When attempting to a drop a column from the array, this would cause an error similar to that of the following ```Received response status [FAILED] from custom resource. Message returned: Statement status was FAILED: ERROR: column "column" of relation "table” already exists``` fixes aws#22208 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…#23011) When attempting to a drop a column from the array, this would cause an error similar to that of the following ```Received response status [FAILED] from custom resource. Message returned: Statement status was FAILED: ERROR: column "column" of relation "table” already exists``` fixes aws#22208 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
Issue Description:
Expected Behavior
Newly created column in redshift has to be deleted when updating cdk code, but it's not happened with the same.
Current Behavior
Following are the error message:
Received response status [FAILED] from custom resource. Message returned: Statement status was FAILED: ERROR: column "groupingkeywithitexxxxxxxx" of relation "orders_lv2_bd_producxxxxx” already exists
Logs: /aws/lambda/SmartPOS-Redshift-Tables--QueryRedshiftDatabase3de-xxxxxx
Reproduction Steps
Using CDK redshift cluster and it's tabled deployed with few columns.
Updated redshift table by adding new column into the existing table, new column is added fine after deploying cdk.
when removing same column from cdk code and deployed cdk. it's failed with following error message.
Received response status [FAILED] from custom resource. Message returned: Statement status was FAILED: ERROR: column "groupingkeywithitexxxxxxxx" of relation "orders_lv2_bd_producxxxxx” already exists
Logs: /aws/lambda/SmartPOS-Redshift-Tables--QueryRedshiftDatabase3de-xxxxxx
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as redshift from '@aws-cdk/aws-redshift-alpha';
import * as core from 'aws-cdk-lib/core';
// import * as sqs from 'aws-cdk-lib/aws-sqs';
export class HelloCdkStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
}
}
========================================
ALTER TABLE test DROP COLUMN ;
Possible Solution
Cdk code should support / update to get this behaviour.
Additional Information/Context
No response
CDK CLI Version
2.42.1 (build 48a95f1)
Framework Version
No response
Node.js Version
v16.17.0
OS
Amazon Linux release 2 (Karoo)
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: