-
Notifications
You must be signed in to change notification settings - Fork 24
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
Unexpected error: Object '{schema_name}' already exists
during Snowflake CREATE SCHEMA
#18
Comments
Object 'SFDC_INPUT_STAGE' already exists
Object '{schema_name}' already exists
Object '{schema_name}' already exists
Object '{schema_name}' already exists
during Snowflake CREATE SCHEMA
First thing to confirm is Snowflake permissions. I've seen this error occur when a user cannot see the schema due to permissions, but then fails to create the schema due to it already existing. Second thing we could double-check is that the schema might exist and just be not located during discovery. A mitigation that doesn't really solve the underlying root cause would be to change the creation script to use |
I've already fixed this issue locally - it's caused by upper- and lowercase handling by the loader. When the SDK checks for the existing schema it compares uppercase and lowercase names of schema resulting in attempt to create a new schema which already exists. |
Thanks, @miloszszymczak. For casing, general best practice with snowflake is to assume (and prefer) uppercase convention. Sounds like we should definitely make the comparison operation case insensitive (if another contributor hasn't done so already) and it might be worth considering doing one or both of the following:
I'm not actively working on this as of now, but if anyone else wants to jump in with a PR, it might be helpful. cc @pnadolny13, @visch for their thoughts as well. |
I think this is a similar issue to the one in target-postgres MeltanoLabs/target-postgres#119. It seems like the code to check existence vs create are using different logic so its causing a mismatch. |
@Jan Soutusta
in slack reported this error:https://meltano.slack.com/archives/C01TCRBBJD7/p1678089929508169?thread_ts=1678088654.698399&cid=C01TCRBBJD7
The text was updated successfully, but these errors were encountered: