All Questions
Tagged with snowflake-cloud-data-platform user-defined-functions
133
questions
1
vote
1
answer
44
views
Snowflake unsupported subquery type for UDTF
In Snowflake, I'm trying to save a large amount of code size and maintenance by creating a UDTF to show flags for each row v based on presence of rows in x or y meeting some pattern.
The error I get ...
0
votes
0
answers
67
views
UDF in Snowpark + DBT gives ModuleNotFoundError with group_by().apply_in_pandas()
I am using snowpark and DBT to do some data transformations and creating some views/table in Snowflake. My models have a structure like this one:
import pandas as pd
from snowflake.snowpark import ...
0
votes
0
answers
49
views
Snowflake Unsupported subquery type cannot be evaluated in UDF
I am trying to create a function that will take an h3id as input and returns the zip5 which the h3id belongs to, In order to do so I have created this UDF:
CREATE FUNCTION get_zip_from_h3(h3_id ...
0
votes
0
answers
32
views
how to Implement of Grouped mapped pandas UDF in snowflake?
I'm a newcomer to Snowflake. I'm migrating databricks pyspark code in snowflake. In Databricks, I have successfully implemented a grouped mapped Pandas UDF where I pass a Spark DataFrame. However, I'm ...
0
votes
1
answer
237
views
How to store Environmental Variables in Snowflake?
I have one use case where I aim to store multiple variables in a Key and Value format in Snowflake only. These variables need to be accessible within Snowflake SQL Statements, and I intend to maintain ...
0
votes
0
answers
80
views
Error 100357 (P0000): Returned Series has a different number of elements than the input
Hi I am using a vectorized python udf - https://docs.snowflake.com/en/developer-guide/udf/python/udf-python-batch
I am making use of a snowflake app and have this code in the udf:
@vectorized(input=...
0
votes
0
answers
47
views
How to convert SQL statement into SQL user-defined function in snowflake?
I have a SQL statement which is working fine in snowflake, but when I converted it into an user-defined function, it is throwing an unexpected error.
This is the SQL statement which is working fine in ...
0
votes
1
answer
69
views
SQL compilation error in user defined sql function in snowflake
I am writing sql user defined function in snowflake but it is throwing compilation error.Can someone please help on this?Thanks
My error is:
syntax error line 2 at position 8 unexpected 'content'. (...
0
votes
1
answer
334
views
Using already deployed Snowflake UDF from snowpark
So I have a prebuilt and predeployed set of Python UDFs that I would like to use from within a snowpark program. I defined the UDFs in SQL:
CREATE OR REPLACE FUNCTION ...
0
votes
1
answer
66
views
How to add a 1 to a phone number and remove the dashes?
I need the value of my data to look like this 18184789564.
I used this code:
REGEXP_REPLACE(+1, b.PHONE_NUMBER, '[^0-9]', '') AS PHONE_NUMBER
I get an error
Numeric value is not recognized
...
1
vote
0
answers
105
views
Returning data from a UDF to Snowflake in a Snowflake Native App
I have a python udf that performs a http request and stores the output in a list and returns this output to snowflake. The http request returns a name for every value sent by it. Here is the code ...
1
vote
2
answers
59
views
Applying a table-valued UDF over multiple rows in another table
I have the following UDF:
CREATE OR REPLACE TEMPORARY FUNCTION sphere_regular_polygon_vertices(
lon1 float,
lat1 float,
s float,
n integer
)
RETURNS table (i integer, a float, lon2 float, lat2 ...
1
vote
1
answer
76
views
Make exceptions become nulls in Snowflake Java UDF
I have a 3rd party JAR that I have made into a UDF as below:
CREATE OR REPLACE FUNCTION MY_DB.MY_SCHEMA.my_udf("FOO" ARRAY)
RETURNS OBJECT
LANGUAGE JAVA
HANDLER = '<proper path>'
...
0
votes
0
answers
106
views
How to write a Snowpark Python code (in Snowflake Snowsight) to PUT data into Netsuite using API / external network access method?
I have a manufacturing firm's data in snowflake database which I need to update it into Netsuite on a daily basis. There are multiple tables that need to be loaded and updated into the Netsuite on a ...
0
votes
0
answers
61
views
Snowpark UDF locking mechanism
In Snowpark version 0.7.0 there was a new locking mechanism added to the UDFs - from Snowflake's release notes:
Added a lock to a UDF or UDTF when it is called for the first time per thread.
When I ...