Specification of data type properties (string length, number precision/scale) for function return schema property are not retained and always proposed as changes #1208
Labels
bug
Used to mark issues with provider's incorrect behavior
category:resource
resource:function
Issue connected to the snowflake_function resource
Provider Version
0.40.0
Terraform Version
1.1.6
Describe the bug
Data type properties such as the length of strings or the precision/scale of numbers set for UDF return-type properties are not retained after apply. The changes to the datatype of a property propagate correctly to the database (i.e., they have the intended effect when using the function), however Terraform will propose the same changes in the next plan again.
Expected behavior
Terraform to not propose such changes in the immediate plan if they have been applied successfully.
Code samples and commands
Define a function like:
Plan the change:
Apply it:
Re-run the plan immediately:
Additional context
At any point after the first plan apply or the apply of any subsequent plan, the function works as expected:
Results:
However, it very much seems that Snowflake doesn't present the correct return-type as well:
All this leads me to think that whatever the Terraform Provider can get from Snowflake while running the ReadFunction isn't enough since Snowflake doesn't seem to retain that additional datatype metadata.
Can you confirm this is a problem caused by Snowflake? If so, perhaps you can help with getting the right ticket to Snowflake Core?
Thanks!
The text was updated successfully, but these errors were encountered: