-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
destination-redshift: add option for drop cascade #38189
destination-redshift: add option for drop cascade #38189
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @stephane-airbyte and the rest of your teammates on Graphite |
adfc65f
to
f4997f3
Compare
f4997f3
to
1164db0
Compare
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.
nit: pr title should be redshift, and I think you linked the wrong issue in the description?
otherwise, one comment about structure, lgtm assuming CI succeeds
@@ -179,7 +180,10 @@ public JsonNode toJdbcConfig(final JsonNode config) { | |||
|
|||
@Override | |||
protected JdbcSqlGenerator getSqlGenerator(final JsonNode config) { | |||
return new RedshiftSqlGenerator(getNamingResolver()); | |||
|
|||
final JsonNode dropCascadeNode = config.get(RedshiftDestinationConstants.DROP_CASCADE_OPTION); |
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 we shove this into a shared method somewhere? (to avoid duplicating between staging+insert destinations)
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.
done
1164db0
to
e595dc7
Compare
e595dc7
to
2aec0d1
Compare
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.
This is great - it gives users the option to self-solve... but:
- we still need to catch the error thrown in this case and turn it into a config_error, not a system_error
- I would have expected to see the spec change to include the new option?
2aec0d1
to
9737d0e
Compare
@evan: indeed. My PRs got mixed up on my local... |
9737d0e
to
ed994c5
Compare
ed994c5
to
88f9755
Compare
88f9755
to
cfefcf0
Compare
if (e.getMessage().contains("ERROR: cannot drop table") && e.getMessage().contains("because other objects depend on it")) { | ||
throw new ConfigErrorException( | ||
"Failed to drop table without the CASCADE option. Consider changing the drop_cascade configuration parameter", e); | ||
} |
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.
This is exactly the type of 'translation' we'll want to move into a more formal 'usability layer' error handling class soon
Merge activity
|
fixes https://github.com/airbytehq/oncall/issues/5226