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

error on dynamic table refresh during #2484

Closed
freylafert opened this issue Feb 11, 2024 · 5 comments
Closed

error on dynamic table refresh during #2484

freylafert opened this issue Feb 11, 2024 · 5 comments
Labels
general-usage General help/usage questions

Comments

@freylafert
Copy link

Terraform CLI and Provider Versions

Terraform v1.5.5
on darwin_arm64

Provider version 0.85.0

Terraform Configuration

resource "snowflake_dynamic_table" "dynamic_table" {
  provider   = snowflake.account_admin
  for_each   = var.dynamic_tables
  database   = var.snowflake_database_name
  warehouse  = var.snowflake_warehouse_name
  schema     = snowflake_schema.collection.name
  name       = each.value.name
  comment    = each.value.name
  or_replace = true
  query      = templatefile("${path.module}/${each.value.sql}", { DB = var.snowflake_database_name, SCHEMA = snowflake_schema.collection.name, IP_INFO_PRIVATE_SHARING = var.ip_info_private_sharing })
  target_lag {
    maximum_duration = var.env == "ci" || var.env == "dev" ? "1 minute" : each.value.target_lag
  }
}

Expected Behavior

expected terraform to be applied

Actual Behavior

Error: too many matches found. There is no way of getting ONLY the 'query' used to create the dynamic table from Snowflake. We try to get it from the whole creation statement but there may be cases where it fails. Please submit the issue on Github (refer to #2329)

#2329

Steps to Reproduce

  1. terraform apply

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

@freylafert freylafert added the bug Used to mark issues with provider's incorrect behavior label Feb 11, 2024
@sfc-gh-asawicki sfc-gh-asawicki added general-usage General help/usage questions and removed bug Used to mark issues with provider's incorrect behavior labels Feb 12, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @freylafert. Thanks for reaching out to us.

Can you share the query you want to run? I suspect that it has multiple SELECT AS in it. This is the limitation in the current provider version which is caused by how Snowflake returns the query. You can check more details in #2329.

There is also an open PR #2438 that will try to solve such problems. We should be able to release it as a part of v0.86.0 (this Wednesday/Thursday).

@freylafert
Copy link
Author

freylafert commented Feb 12, 2024

Thank you for the quick answer, yes, we have multiple statements like this in the queries:
WITH unique_accounts_per_day_on_ip AS

@sfc-gh-asawicki
Copy link
Collaborator

Great, then it will be a good test for the change from #2438 (please check it, after we release v0.86.0.

@sfc-gh-asawicki
Copy link
Collaborator

Hey @freylafert. We have released 0.86.0 yesterday. Could you check if this solves your issue, please?

@freylafert
Copy link
Author

Yes, the issue was resolved, closing the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general-usage General help/usage questions
Projects
None yet
Development

No branches or pull requests

2 participants