-
Notifications
You must be signed in to change notification settings - Fork 427
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
UDF Retrun datatype is not being applied correctly for the NUMBER with scale #2735
Comments
Hey @syed3477. Thanks for reaching out to us. I will try to reproduce the issue this week and I will get back to you. |
Hello, I'm just checking in to see if there are any plans to address this bug in an upcoming release. Any updates would be greatly appreciated. Thank you! |
Hey @syed3477. I will let you know today. |
Hey @syed3477. I have just checked what's causing the incorrect behavior. The source of the problem is complex and we can't fix this easily. We will address this with the upcoming functions/procedure rework as part of https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#preparing-essential-ga-objects-for-the-provider-v1 (also: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/v1-preparations/ESSENTIAL_GA_OBJECTS.MD). The current workarounds (not ideal) are either:
|
- Add missing parameters (References #2676) - Temporary fix the warehouse resource behavior; it will be addressed with the warehouse redesign because the existing conditional logic is questionable and we plan to get rid of the defaults (SNOW-1348102) (References #2763) - Prove data type problem with functions; it will be addressed with function redesign because it requires deeper refactor (SNOW-1348103) (References #2735) - Suppress the diff for synonym columns in table resource; it will be addressed with table redesign because the collate test had to be skipped (SNOW-1348114) (References #2733)
🤖 I have created a release *beep* *boop* --- ## [0.90.0](v0.89.0...v0.90.0) (2024-05-08) ### 🎉 **What's new:** * Adjust owner_role_type and schema_evolution_record columns ([#2740](#2740)) ([424e393](424e393)) ### 🔧 **Misc** * Add a guide on creating issues ([#2758](#2758)) ([2b006aa](2b006aa)) * Add missing documentation ([#2781](#2781)) ([cc0a6a7](cc0a6a7)) * Add scripts to close issues from Pre Snowflake bucket ([#2762](#2762)) ([44c0c37](44c0c37)) * Add small adjustments ([#2783](#2783)) ([e5b0b4b](e5b0b4b)) * Adjust issue templates ([#2748](#2748)) ([64ab76d](64ab76d)) * Cleanup helpers part 3 ([#2730](#2730)) ([eb7bee4](eb7bee4)) * Cleanup helpers part 5 ([#2744](#2744)) ([1f165bf](1f165bf)) * Cleanup helpers part4 ([#2741](#2741)) ([9475e35](9475e35)) * Cleanup helpers part6 ([#2745](#2745)) ([eba3029](eba3029)) * Cleanup helpers poc ([#2724](#2724)) ([70b99fb](70b99fb)) * Helpers cleanup continuation ([#2726](#2726)) ([a70d1af](a70d1af)) * Prepare new roadmap entry ([#2773](#2773)) ([b0bf28f](b0bf28f)) * Prepare parallel builds ([#2737](#2737)) ([6974e25](6974e25)) * Update the contribution guidelines (and small fixes) ([#2753](#2753)) ([aafdc72](aafdc72)) ### 🐛 **Bug fixes:** * Fix issue templates ([#2760](#2760)) ([d0d5048](d0d5048)) * Fix setup for two tests ([#2757](#2757)) ([df025b0](df025b0)) * Fix Test (wrong order of arguments) ([#2780](#2780)) ([02f467e](02f467e)) * Fix/prove issues [#2733](#2733) [#2735](#2735) [#2763](#2763) [#2767](#2767) ([#2777](#2777)) ([7b1c67e](7b1c67e)) * Prove problems with procedure resource data types ([#2782](#2782)) ([68d0318](68d0318)) * read after create ([#2718](#2718)) ([2e9b68f](2e9b68f)) * UNSET and empty SET in network policies ([#2759](#2759)) ([3eacb0b](3eacb0b)) * unset network policy should not have single quotes ([#2584](#2584)) ([8f2a363](8f2a363)) * Update failover group allowed integration types ([#2776](#2776)) ([efde48d](efde48d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
Hey @syed3477. In v0.100.0, we have introduced new function resources. The handling of data types was greatly improved. PLease check it out and let us know if this solves your issue. |
Closing due to inactivity. |
Terraform CLI and Provider Versions
Terraform v1.7.5
Terraform Configuration
Expected Behavior
When running this function, it should give
Actual Behavior
Steps to Reproduce
resource "snowflake_function" "test_function_number" {
provider = snowflake.sysadmin
database = var.database_name
schema = var.schema_name
name = "TEST_FUNCTION_NUMBER"
comment = "Test Table function"
return_type = "TABLE (NUM1 NUMBER, NUM2 NUMBER(10,2))"
statement = <<EOT
SELECT 12,13.4
EOT
}
terraform apply
select * from table(Test_function_number());
How much impact is this issue causing?
High
Logs
https://gist.github.com/syed3477/6e59d4e88db8dd1f0aca789faeac0d62
Additional Information
This is being applied to Snowflake
CREATE OR REPLACE FUNCTION TF_DEV_SUT_DB.GTD_RPT.TEST_FUNCTION_NUMBER()
RETURNS TABLE ("NUM1" NUMBER(38,0), "NUM2" NUMBER(38,0))
LANGUAGE SQL
COMMENT='Test Table function'
AS ' SELECT 12,13.4
';
This is working correctly in the version = "0.46.0"
If any one has any workaround, please share. Thanks!
The text was updated successfully, but these errors were encountered: