Skip to content
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

[Snowflake] Create primary keys in the destination if they exist in the schema #2134

Open
rudolfix opened this issue Dec 11, 2024 · 0 comments
Assignees
Labels
support This issue is monitored by Solution Engineer

Comments

@rudolfix
Copy link
Collaborator

Backrgound
Snowflake allows to add hints to columns for PRIMARY KEY and UNIQUE. those hints are not enforced but used for query planning. We want to add those hints to SQL we generate - like we do for postgres or duckdb.

Tasks

    • make behavior optional and switched off by default
    • generate PRIMARY KEY and UNIQUE hints.
    • make sure to test what happens if we set both
    • tests multi column hints. not sure if they are supported

More info
https://docs.snowflake.com/en/sql-reference/constraints-overview
It seems that multi column hints must be generated as separate SQL statement. That may need some changes in sql_job_client. there was support for that but never used

@rudolfix rudolfix moved this from Todo to In Progress in dlt core library Dec 11, 2024
@rudolfix rudolfix moved this from In Progress to Planned in dlt core library Dec 11, 2024
@rudolfix rudolfix added the support This issue is monitored by Solution Engineer label Dec 11, 2024
@rudolfix rudolfix moved this from Planned to In Progress in dlt core library Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support This issue is monitored by Solution Engineer
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants