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

[Bug]: Column names being escaped unnecessarily #2844

Open
1 task done
pbsf opened this issue May 29, 2024 · 2 comments
Open
1 task done

[Bug]: Column names being escaped unnecessarily #2844

pbsf opened this issue May 29, 2024 · 2 comments
Labels
bug Used to mark issues with provider's incorrect behavior resource:table Issue connected to the snowflake_table resource

Comments

@pbsf
Copy link

pbsf commented May 29, 2024

Terraform CLI Version

v1.5.7

Terraform Provider Version

11.3.2

Terraform Configuration

resource "snowflake_table" "table" {
  database                    = snowflake_schema.schema.database
  schema                      = snowflake_schema.schema.name
  name                        = "table"

  column {
    name     = "my'id"
    type     = "int"
    nullable = false
  }
}

Category

category:resource

Object type(s)

resource:table

Expected Behavior

I'd expect the column to be created with the name "my'id".

Actual Behavior

The column is created with the name "my\'id".

Steps to Reproduce

Run terraform apply.

How much impact is this issue causing?

Low

Logs

No response

Additional Information

Since Snowflake allows columns to have ' in it, so should its TF provider.

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@pbsf pbsf added the bug Used to mark issues with provider's incorrect behavior label May 29, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @pbsf. Thanks for reaching out to us.

The table resource will be redesigned shortly as part of /~https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#preparing-essential-ga-objects-for-the-provider-v1. It has multiple problems (you can check them here: /~https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/v1-preparations/ESSENTIAL_GA_OBJECTS.MD). I will add this one to the list.

In the meantime, as a workaround: just don't use ' in the column names.

@sfc-gh-asawicki sfc-gh-asawicki added the resource:table Issue connected to the snowflake_table resource label May 31, 2024
@pbsf
Copy link
Author

pbsf commented May 31, 2024

@sfc-gh-asawicki, thanks for the quick response.

In the meantime, as a workaround: just don't use ' in the column names.

Unfortunately, this is required in my use case: data is being ingested from .csv files into Snowflake, and the .csv headers have ' in them. I've forked this repository and will be using my workaround instead.

I am looking forward to the redesign changes once they are ready.

Thanks for maintaining this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior resource:table Issue connected to the snowflake_table resource
Projects
None yet
Development

No branches or pull requests

2 participants