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

file_format for TYPE = CSV not being correctly populated in the state file. #497

Closed
weiminmei opened this issue Mar 17, 2021 · 1 comment
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@weiminmei
Copy link

weiminmei commented Mar 17, 2021

Provider Version
0.23.0

Terraform Version
0.14.8

Describe the bug

For the file_format CSV, subsequent terraform plan keeps causing an update in-place due to the terraform state file being populated with "NULL_IF = [].

~ resource "snowflake_stage" "citibike_stage" {
~ file_format = "NULL_IF = []" -> "TYPE = CSV NULL_IF = []"
id = "CITIBIKE|PUBLIC|CITIBIKE_TRIPS"
name = "CITIBIKE_TRIPS"
# (3 unchanged attributes hidden)
}

Expected behavior

The resource block below should not result in subsequent updates as the file_format is as expected.

Code samples and commands

resource "snowflake_stage" "citibike_stage" {
name = "CITIBIKE_TRIPS"
url = "s3://snowflake-workshop-lab/citibike-trips"
database = "CITIBIKE"
schema = "PUBLIC"

#168

file_format = "TYPE = CSV NULL_IF = []" #BUG
credentials = ""
depends_on = [
# snowflake_schema_grant.grant,
snowflake_database.citibike,
]
}

Additional context

This code block for TYPE = JSON exhibits the correct behaviour.

resource "snowflake_stage" "nyc_weather" {
name = "NYC_WEATHER"
url = "s3://snowflake-workshop-lab/weather-nyc"
database = "WEATHER"
schema = "PUBLIC"
file_format = "TYPE = JSON NULL_IF = []"
depends_on = [
snowflake_database.weather,
]
}

Add any other context about the problem here.

Here is the tfstate entry for the bug.

"schema_version": 0,
"attributes": {
"aws_external_id": "",
"comment": "",
"copy_options": "",
"credentials": "",
"database": "CITIBIKE",
"encryption": null,
"file_format": "NULL_IF = []",
"id": "CITIBIKE|PUBLIC|CITIBIKE_TRIPS",
"name": "CITIBIKE_TRIPS",
"schema": "PUBLIC",
"snowflake_iam_user": "",
"storage_integration": "",
"url": "s3://snowflake-workshop-lab/citibike-trips"
},

Here is the tfstate entry for the JSON type that doesn't exhibit this issue:

"schema_version": 0,
"attributes": {
"aws_external_id": "",
"comment": "",
"copy_options": "",
"credentials": null,
"database": "WEATHER",
"encryption": null,
"file_format": "TYPE = JSON NULL_IF = []",
"id": "WEATHER|PUBLIC|NYC_WEATHER",
"name": "NYC_WEATHER",
"schema": "PUBLIC",
"snowflake_iam_user": "",
"storage_integration": "",
"url": "s3://snowflake-workshop-lab/weather-nyc"
},

@weiminmei weiminmei added the bug Used to mark issues with provider's incorrect behavior label Mar 17, 2021
@sfc-gh-asawicki
Copy link
Collaborator

We are closing this issue as part of a cleanup described in announcement. If you believe that the issue is still valid in v0.89.0, please open a new ticket.

@sfc-gh-asawicki sfc-gh-asawicki closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
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
Projects
None yet
Development

No branches or pull requests

2 participants