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

Issue with "cluster_by" in snowflake_table when written to state file #2495

Open
JESCHO99 opened this issue Feb 13, 2024 · 2 comments
Open
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@JESCHO99
Copy link

Terraform CLI and Provider Versions

0.85.0

Terraform Configuration

resource "snowflake_table" "test" {

  database            = "TEST"
  schema              = "TEST"
  name                = "TEST"
  data_retention_time_in_days = 1
  change_tracking     = false

  cluster_by = [
    "date_trunc('month', LAST_LOAD_TIME)",
    "STATUS"
  ]

  column {
    name     = "LAST_LOAD_TIME"
    type     = "TIMESTAMP_LTZ(6)"
    nullable = true
  }

  column {
    name     = "STATUS"
    type     = "VARCHAR(16777216)"
    nullable = true
  }

}

Expected Behavior

Expression in the cluster_by parameter is written at once in the state file and is not splitted into several part at every "," in the list.

Actual Behavior

The expression is split on every "," which leads to a situation where the table plans changes for the cluster by column in every plan which is executed
image

Steps to Reproduce

  1. terraform apply
  2. terraform apply

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

@JESCHO99 JESCHO99 added the bug Used to mark issues with provider's incorrect behavior label Feb 13, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @JESCHO99. Thanks for creating the issue.

We are aware of that problem, and we have it on our roadmap. I hope we will address it soon.

sfc-gh-asawicki added a commit that referenced this issue Feb 23, 2024
sfc-gh-asawicki added a commit that referenced this issue Feb 26, 2024
- Fixed clustering for table_resource (clustering with nested functions
are parsed correctly now)
- Adjusted view resource (`copy_grants` require `or_replace`) and
corrected the documentation

References: #2110 #2495 #2519
@sfc-gh-asawicki
Copy link
Collaborator

Hey @JESCHO99. We have released the fix as part of v0.87.0 release. Please follow the migration guide during the update. Please confirm that the issue is resolved in the newest version. Thanks!

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