terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

[Bug]: `snowflake_function` cannot create table functions with double-quoted columns

Open yo0824 opened this issue 1 year ago • 1 comments

Terraform CLI Version

1.9.2

Terraform Provider Version

0.93.0

Terraform Configuration

resource "snowflake_function" "test" {
  database  = "TEST_DB"
  schema    = "TEST_SCHEMA"
  name      = "TEST"
  return_type = <<-EOT
  TABLE (
    "PoC" BOOLEAN
  )
  EOT
  statement = "select true"
}

Category

category:resource

Object type(s)

resource:function

Expected Behavior

terraform apply successfully creates a table function.

Actual Behavior

terraform apply fails with the following error message :

│ Error: 001003 (42000): SQL compilation error:
│ syntax error line 1 at position 58 unexpected 'VOLATILE'.

Steps to Reproduce

  1. Copy the configuration as written above
  2. Run terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

Would you like to implement a fix?

  • [ ] Yeah, I'll take it 😎

yo0824 avatar Aug 29 '24 05:08 yo0824

Hey 👋 Thanks for reporting this issue. We'll take a closer look at it when preparing function resource for v1. It's in our essential objects list, so we should pick it up sooner than later.

sfc-gh-jcieslak avatar Aug 29 '24 07:08 sfc-gh-jcieslak

Hey @yo0824.

In v0.100.0, we have introduced new function resources. Column names (and argument names) are now quoted by the provider. Please check it and let us know if this solves your issue.

sfc-gh-asawicki avatar Dec 13 '24 14:12 sfc-gh-asawicki

Closing due to inactivity.

sfc-gh-asawicki avatar Jan 13 '25 22:01 sfc-gh-asawicki