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]: snowflake_file_format resource ignores USE_LOGICAL_TYPE and REPLACE_INVALID_CHARACTERS #3185

Open
1 task
a-schot opened this issue Nov 8, 2024 · 1 comment
Labels
bug Used to mark issues with provider's incorrect behavior resource:file_format Issue connected to the snowflake_file_format resource

Comments

@a-schot
Copy link

a-schot commented Nov 8, 2024

Terraform CLI Version

1.9.8

Terraform Provider Version

0.96.0

Company Name

PGGM

Terraform Configuration

resource "snowflake_file_format" "parquet" {
  name     = "FF_PARQUET_DEFAULT"
  database = "db_name"
  schema   = "schema_name"

  format_type                = "PARQUET"
  compression                = "AUTO"
  binary_as_text             = true
  trim_space                 = false
  replace_invalid_characters = true
}

Category

category:resource

Object type(s)

resource:file_format

Expected Behavior

After running terraform apply running DESCRIBE FILE FORMAT in Snowflake shows:

  • REPLACE_INVALID_CHARACTERS set to TRUE

An option in Terraform called use_logical_type with the same default as the Snowflake which sets (and checks when planning) the USE_LOGICAL_TYPE property for the relevant file formats.

Additionally, running

ALTER FILE FORMAT db_name.schema_name.ff_parquet_default
SET 
USE_LOGICAL_TYPE = TRUE
REPLACE_INVALID_CHARACTERS = TRUE
;

And rerunning terraform apply does not detect changes in the configuration, leading me to suspect it's not being checked in the provider.

Actual Behavior

After running terraform apply running DESCRIBE FILE FORMAT in Snowflake shows:

  • REPLACE_INVALID_CHARACTERS set to FALSE
  • USE_LOGICAL_TYPE set to FALSE

The defaults for both these properties

Steps to Reproduce

  1. Apply the terraform configuration
  2. Check the resulting file format using DESCRIBE FILE FORMAT db_name.schema_name.ff_parquet_default
  3. Run again (my result: no changes)
  4. Alter the file format using the snippet in Actual Behavior
  5. Run again (my result: no changes)

How much impact is this issue causing?

Low

Logs

No response

Additional Information

No response

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@a-schot a-schot added the bug Used to mark issues with provider's incorrect behavior label Nov 8, 2024
@sfc-gh-jmichalak
Copy link
Collaborator

sfc-gh-jmichalak commented Nov 8, 2024

Hi @a-schot 👋

I think this is similar to #3163, but that issue missed USE_LOGICAL_TYPE. Our answer is similar here: we are currently focused on pushing all necessary things toward the recently announced v1. We'll fix this during rework of file_format resource after v1. For now, please try to utilize the unsafe_execute as a way to alter or completely manage the file format.

@sfc-gh-jmichalak sfc-gh-jmichalak added the resource:file_format Issue connected to the snowflake_file_format resource label Nov 8, 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 resource:file_format Issue connected to the snowflake_file_format resource
Projects
None yet
Development

No branches or pull requests

2 participants