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]: Unable to set the replace_invalid_characters option for parquet files #3163

Open
1 task
cekelly opened this issue Oct 29, 2024 · 2 comments
Open
1 task
Assignees
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@cekelly
Copy link

cekelly commented Oct 29, 2024

Terraform CLI Version

1.7.5

Terraform Provider Version

0.78.0

Terraform Configuration

resource "snowflake_file_format" "CREATE_FILE_FORMAT" {
    provider = snowflake.account_admin
    depends_on = [
        snowflake_stage.CREATE_STAGE
    ]

    name = each.value.name
    format_type = each.value.format_type
    database = each.value.database
    schema = each.value.schema
    binary_as_text = true
    replace_invalid_characters = true

    for_each={
        for key, value in local.file_formats : key => {
            name = value.name
            format_type = value.format_type
            database = value.database
            schema = value.schema
        }if alltrue([contains(value.in_level, var.current_level.name), contains(value.in_env, var.current_env)])
    }
}

Category

category:resource

Object type(s)

resource:file_format

Expected Behavior

You should be able to set replace_invalid_characters option for the file format using the provider

Actual Behavior

No change on the option replace_invalid_characters occurs, it is always set to the default of false

Steps to Reproduce

Using the following config, run a terraform plan, then an apply, then go to snowflake and see the value

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

Would you like to implement a fix?

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

sfc-gh-sghosh commented Oct 30, 2024

Hello @cekelly ,

Thanks for raising the issue, we are able to reproduce the issue, will work on it.
I can see its not honoring the property even though we passed it from Terraform config file

desc file format TF_PARQUET_FILE_FORMAT1;
REPLACE_INVALID_CHARACTERS | Boolean | false | false

`terraform {
required_providers {
snowflake = {
source = "Snowflake-Labs/snowflake"
version = "~> 0.87"
}
}
}

provider "snowflake" {
account = "account" # the Snowflake account identifier
user = "xxxx"
password = "xxxx"
role = "xxxxx"
}

resource "snowflake_file_format" "parquet_file_format" {
name = "TF_PARQUET_FILE_FORMAT1"
format_type = "PARQUET"

database = "TF_DATABASE"
schema = "TF_SCHEMA"

binary_as_text = true
compression = "AUTO"
replace_invalid_characters = true
null_if = ["\N"]
}`

Regards,
Sujan

@sfc-gh-jcieslak sfc-gh-jcieslak self-assigned this Oct 30, 2024
@sfc-gh-jcieslak
Copy link
Collaborator

Hey @cekelly 👋
We are currently focused on pushing all necessary things toward the recently announced v1. We will try to find some time to fix this earlier, but most likely, this will be a fix that will be done as part of file format refactoring that will take place after the v1 release. For now, please try to utilize the unsafe_execute as a way to alter or completely manage the file format.

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

3 participants