terraform-provider-snowflake
terraform-provider-snowflake copied to clipboard
null_if value in file_format cannot be set to ''
Provider Version
0.25.19
Terraform Version
1.0.3
Describe the bug
It's impossible to create a file_format with a null_if
that compiles in snowflake to
"NULL_IF":[""]
It should be possible with:
null_if = [""]
but this gives in Snowflake
"NULL_IF":[]
In the code of the provider here: https://github.com/chanzuckerberg/terraform-provider-snowflake/blob/e3e412942c6706942b5dd21af8ea51658ea0ff5b/pkg/snowflake/file_format.go#L339
Should we change the default to be
q.WriteString(` NULL_IF = ('')`)
as it's the one to consider an empty value as null?
Thanks for raising this. I am having the same issue. Would like to see a fix for this please.
Would also like to see a fix for this
also experiencing this, and saddened to see zero address of a bug after so many months
@syldor I have tested this in the latest version (0.44.0) and this does not seem to be an issue anymore. My example terraform configuration is:
resource "snowflake_file_format" "example_file_format" {
name = "EXAMPLE_FILE_FORMAT"
database = snowflake_database.test.name
schema = snowflake_schema.test.name
format_type = "CSV"
null_if = [""]
}
and the resulting query in Snowflake is:
CREATE FILE FORMAT "test"."test"."EXAMPLE_FILE_FORMAT" TYPE = 'CSV' NULL_IF = () SKIP_BLANK_LINES = false TRIM_SPACE = false ERROR_ON_COLUMN_COUNT_MISMATCH = false REPLACE_INVALID_CHARACTERS = false EMPTY_FIELD_AS_NULL = false SKIP_BYTE_ORDER_MARK = false
Which, as you can see the value is correctly set to NULL_IF = ()
If you can please upgrade to the latest version, that should resolve your issue.
I think the correct value is NULL_IF = ('')
, not NULL_IF = ()
.
Whether Still this issue exist ,since i am facing still the issue ..its going as NULL_IF = () for ""
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.