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

Collation error on BOOLEAN and NUMBER(38,0) type columns #2657

Closed
MyJBMe opened this issue Mar 26, 2024 · 2 comments
Closed

Collation error on BOOLEAN and NUMBER(38,0) type columns #2657

MyJBMe opened this issue Mar 26, 2024 · 2 comments
Assignees
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@MyJBMe
Copy link

MyJBMe commented Mar 26, 2024

Terraform CLI and Provider Versions

0.87.0, 0.87.1, 0.87.2

Terraform Configuration

terraform {
  required_providers {
    snowflake = {
      source  = "Snowflake-Labs/snowflake"
      version = "~> 0.86.0"
    }
  }
backend "s3" {}

}

Expected Behavior

Deployment of all tables without any issues.
As far as I understand column collation, it should not apply to non-text columns, doesn't it? At least it seems to be about text (documentation states: "Collation allows you to specify alternative rules for comparing strings", https://docs.snowflake.com/en/sql-reference/collation#label-collation-definition). Thereby I wonder about getting issues for different datatypes, since I would expect the provider to not apply collation to non-text columns.

Actual Behavior

Error: error changing property on DATABASE|SCHEMA|TABLE: err 001478 (42601): SQL compilation error:
│ Cannot specify column collation for data type 'BOOLEAN' for column 'COLUMN9'

│ with module.xxx.snowflake_table.table_name,
│ on stack/module_name/tables_base.tf line 57, in resource "snowflake_table" "table_name"

Error: error changing property on DATABASE|SCHEMA|TABLE: err 001478 (42601): SQL compilation error:
│ Cannot specify column collation for data type 'NUMBER(38,0)' for column 'ID'

│ with module.xxx.snowflake_table.table_name,
│ on stack/module_name/tables_base.tf line 67, in resource "snowflake_table" "table_name"

Steps to Reproduce

  1. Create .tf file with resource:

resource "snowflake_table" "table_name" {
database = var.DATABASE_NAME
schema = var.SCHEMA_NAME
name = var.TABLE_NAME
comment = "A table containing [...]"

change_tracking = true

column {
name = "ID"
type = "NUMBER(38,0)"
}

column {
name = "AVAILABLE"
type = "BOOLEAN"
}
}

  1. terraform apply
  2. Issues should occur after the second deployment (e.g. after updating existing resources)

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

@MyJBMe MyJBMe added the bug Used to mark issues with provider's incorrect behavior label Mar 26, 2024
@sfc-gh-asawicki sfc-gh-asawicki self-assigned this Mar 27, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @MyJBMe. Thanks for reaching out to us.

It looks like a duplicate of #2588. It was fixed in #2607. It was not officially released yet, but it is available in the release candidate v0.87.3-pre. It's available in the registry but you have to specify the whole version string to use it.

@sfc-gh-asawicki
Copy link
Collaborator

Closing as it was fixed in #2607. Please open a new issue if the problem persists in the newest provider version.

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