-
Notifications
You must be signed in to change notification settings - Fork 428
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
SNOW-1348106: Terraform crashes when creating a stored procedure that returns a NUMBER #1195
Comments
We are seeing this exact same thing but with a PROCEDURE that returns a VARCHAR (I don't think that's the problem)... We see the PROCEDURE correctly created, and then it appears to read back the PROCEDURE with
|
I had a specific stored procedure written in Snowflake Scripting that originally returned a NUMBER, hence the title of this post and the sample procedure provided. The provider fails to generate this procedure when NUMBER or NUMBER(p, s) is the data type returned but succeeds when FLOAT is the data type returned! For this specific procedure, this is my current workaround. I initially thought that the provider had problems handling procedures returning Snowflake data types somehow incompatible with JavaScript (as far as Snowflake is concerned). Seeing an issue now reported when the returned data type is VARCHAR suggests something else. Parenthesis? Finally, I can confirm that the provider succeeds in generating Snowflake Scripting procedures that return semi-structured data types (ex. ARRAY, VARIANT). In the solution I'm currently working on, such procedures are frequent and, so far , things run smoothly. The problem has to be linked to the returned data type, somehow. Hope this helps, AL |
Hey @lepagea01. In v0.100.0 we have introduced new procedure resources. Handling different data types was greatly improved, so they should work correctly in the presented case. Please check it out and let us know. |
closing issue per above comment. Do let us know please if you still see this issue even in v0.100.0 / v1 of the provider. |
Provider Version
provider registry.terraform.io/snowflake-labs/snowflake v0.42.1
Terraform Version
Terraform v1.2.8
on darwin_arm64
Describe the bug
The provider/plugin crashes when creating a stored procedure written in Snowflake Scripting that returns a NUMBER. Note that the crashes happen after the procedure is created in Snowflake. The stored procedure is not saved in terraform's state.
Expected behavior
To create such a stored procedure successfully (in both Snowflake and terraform's state) and resume gracefully.
Code samples and commands
The crash is systematic and can be reproduced with the following code sample:
main.tf
versions.tf
Additional context
Based on the partial debug output below (a complete debug output is attached), especially the line
panic: runtime error: index out of range [1] with length 0
, it seems to me that the plugin does not expect NUMBER as a possible type returned by a stored procedure (it is new to stored procedures written in Snowflake Scripting). I may be wrong.Thanks,
debug_output.log
The text was updated successfully, but these errors were encountered: