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

CSV snowflake_file_format errors and doesn't set system default when omitting optional values #1613

Open
aclarkot opened this issue Mar 14, 2023 · 0 comments
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:file_format Issue connected to the snowflake_file_format resource

Comments

@aclarkot
Copy link

Provider Version

v0.58.0

Terraform Version

v1.3.4

Describe the bug

When you omit any of the optional values for a CSV file format terraform errors, for example:

│ Error: error updating file format record delimiter on MY_DATABASE|RAW|CSV_FORMAT err = 001008 (22023): SQL compilation error:
│ invalid value [''] for parameter 'RECORD_DELIMITER'

You end up having to explicitly define every optional value even when you are using the system defaults.

If you create the file format directly in Snowflake you don't need to define all the optional values, they are defaulted.

This seems to happen when any of the optional values are omitted: binary_format, encoding, escape, escape_unenclosed_field, field_optionally_enclosed_by, field_delimiter, skip_header, compression,

Expected behavior

There should be no error and the system default for the omitted value should be used E.g. record_delimiter = "\n".

resource "snowflake_file_format" "CSV" {
  name                         = CSV_FORMAT
  database                     = MY_DATABASE
  schema                       = RAW
  format_type                  = CSV

  binary_format                = "HEX"
  encoding                     = "UTF8"
  escape                       = "NONE"
  escape_unenclosed_field      = "\\"
  field_optionally_enclosed_by = "\""
  field_delimiter              = ","
  skip_header                  = 1
  compression                  = "AUTO"
}

Please add code examples and commands that were run to cause the problem.

Additional context

Add any other context about the problem here.

@aclarkot aclarkot added the bug Used to mark issues with provider's incorrect behavior label Mar 14, 2023
@sfc-gh-jcieslak sfc-gh-jcieslak added category:resource resource:file_format Issue connected to the snowflake_file_format resource labels May 20, 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 category:resource resource:file_format Issue connected to the snowflake_file_format resource
Projects
None yet
Development

No branches or pull requests

2 participants