Snowflake-cloud-data-platform Questions
Ad
Fastest way to create a copy of snowflake database
I need to make a copy of the database to check my code before release in snowflake. currently, we use clone method for creating copy of
snowflake regex_replace not working as expected
I am trying to do this that strips "['" or "']" in the string. for example, if we have ['customer name'] it should be
Snowflake function parameters with wildcard in where clause
Do you know why the following function call wont work using wildcards inside the parameter? create or replace function
Create an associated matching ID based on multiple columns in the same table
I have an interesting issue where i need to create a unique identifier based on match groups for a set of data. this is is based on multiple
Getting Numeric value not recognized
select id,index,purchase_list, nvl(case when index = 2 then purchase_list end,0) as qty, sum(nvl(case when index = 2
Is if...exists supported in Snowflake stored procedures?
I have written a stored procedure which will be called from python. the stored procedure needs to insert the variant data into my table if the id
SQL:ANSI Output a table with ID's when values first move from 0 to any positive number
I have a table with id's, dates, and values. i'd like to retrieve each unique id (date and value) the first time the value moves specifically from
snowflake - using select statement to delete rows
I have the below query: select a.* from id_stats a join id_list b on a.id = b.id and a.start_date not between b.start_date::date
Snowflake does not work on M1 Macbook Pro "Can't open lib". Any solution or update?
I try to get snowflake running on my m1 macbook pro, but whatever i do i get the same error message. i have found different questions related to
Cannot query snowflake external S3 stage with path
I have few files in the s3 bucket and i have created a stage for it. when i query the stage, i get the filenames.
Ad
check for null values while finding timestamps from date+time
Previously, i was parsing json like this (date and time separately) select json_data:"required_time"::time as
Failed to build pyarrow during installation of Snowflake-SQLAlchemy through pip installation
I am trying to use snowflake python connector through sqlalchemy, while i am running pip install
SQL for Monthly YOY (percentage change while keeping the monthly data frequency)?
Suppose i have a table called monthly metrics. sample row in table below:
Snowflake SQL stored procedure and save value from query with dynamic SQL
I am writing a sql stored procedure in snowflake (language sql not javascript). i am trying to save a count from a select statement into a
Issues Splitting values separated by delimiters and creating columns for each split in snowflake
I am new to snowflake and i am trying to run an sql query that splits values with delimiters(semi-column) and create columns for each
Group by name and return row with most recent date
Suppose you have the following data: +-------+--------+------------+ | name | rating | date |
Terraform Snowpipe on Azure error on integration
I'm trying to set up snowpipe with terraform on azure using
Within snowflake stored procedure set variable and use it within the same procedure as a copy pattern
I am trying to create a stored procedure to copy from the external stage (s3 bucket) and use a pattern for the file name. the pattern is based on
How to convert multiple columns into single column in snowflake table using query
I have a table "table1" like below date src_counrty src_state dst_country dst_state value
Issues running Max function and Order by in snowflake sql
I am new to snowflake and i am trying to run an sql query that would extract the maximum datetime for each id. below is a sample of my data
How to select a substring up to a character in snowflake?
My table in snowflake has a column with string values. the string has comma and slash. i need to list only the values before first comma
Ad
Self joining next date in table as another date field
Trying to work with an exchange rate table and a transactions table, and how the transactions are joined to the exchange table depends on when the
SQL - Find customers who have not ordered in the last year and what they ordered
I am able to find the customers who have not ordered in the last year by doing this: select o.custid, max(o.orderdate) as lastorder
Snowflake DW conncetion with Node.js driver
I am using the sample code provided by snowflake for connecting with node.js driver, but keep getting following errors:
In the new Snowflake Worksheet UI, how do you see the query history?
In the "classic console" worksheet, at the bottom right you could see the query history, which was great for jumping around results set,
Find the difference between 1 column depending on date
When i run this: select name from t1 where _load_datetime::date = '2022-01-31' i see 62 rows but when i
Varchar to Number in Snowflake
I am trying to convert data type for a column from varchar to number but i was not successful. tried below functions: try_to_number cast
extract the most common (highest count) entry by group
I have the following table: id height persona 182 persona 182 persona 182 persona 192 persona 172 personb 175 personb
AttributeError: 'SnowflakeCursor' object has no attribute 'shape'
Is there a way to use "pd.read_sql_query" w/ snowflake? i am trying to read my snowflake query in a pandas dataframe, however i
Javascript Array in snowflake procedure
I have a snowflake procedure that creates a table using the parameters passed to a snowflake procedure as below: create or replace
How to calculate the balance on the difference of two amount columns based on date?
I have a table that has two different columns for amounts. first_amount & second_amount. i need to find the balance of the difference of the
issues converting output from a view to json and array in snowflake using SQL
I am new to snowflake and have successfully created a view from a table using sql, but i am having issues creating a view that transforms the
Ad
Cannot create UDFs returning "Table" in Snowflake - compilation error
Use agdwhdev.edw_weather; -- my database and schema create or replace function edw_weather.find_nearest_radar() returns table (latitude
Snowflake - How do I handle a bad Virtual Column after it is INSERTed?
I am surprise that i can insert a row that results in a virtual column going bad. how then do i detect the bad virtual columns and handle it
Same column with different values into single output
Greeting :) it might be a simple snowflake problem but i'm struggling with this.. i want to gather different values in the same
How to clear last run query (Cache) in snowflake
I want to test query performance . example: select * from vw_testrole. vw_testrole- has lot of joins. since the data is cached, it
Use last_value() with group_by instead of as window function in Snowflake
I would like to use last_value() or any similar function in a group by query instead of as a window function. it it
Creating a Snowflake View with a Sequence
Is it possible to use a sequence inside a view?? i am using the following query: create view < view_name > (id, value1,
Converting table with Varchar columns to custom JSON in Snowflake
I have a table that has the following data start_date
Converting the timestamp in Snowflake
I'm trying to convert the snowflake timestamp that is compatible with
Converting data type inside OBJECT_CONSTRUCT in snowflake
I'm using snowflake's
Last day of most recent financial quarter in Snowflake
Is there a simple way to return the last day of the most recent quarter in snowflake? we use financial quarters with last days being: jan.
Ad
extract year_month from a column along with other columns in a sql table
I have a sql table with multiple fields including (but not limited to the following): member_id, visit_date (in datetime format eg: 2016-01-01),
How to return 0 if null from UDF in Snowflake
I am writing user defined functions in snowflake and doing some select in the functions. i need to return 0 if select returns null. in the
Snowflake database: Question on table performance which is stored in snowflake
We have a continuous insert, update, and delete in a table that is in snowflake db, can this slow down the performance of a table in snowflake
dbms_random.value() in Snowflake - Oracle to snowflake conversion
Below is the oracle sql query that i got to convert to snowflake. in here, i am blocked in creating dbms_random.value() in snowflake
How to solve error "Field delimiter ',' found while expecting record delimiter '\n'" while loading json data to the stage
I am trying to "copy into" command to load data from s3 to the snowflake below are the steps i followed to create the stage and
How to ADD PEOPLE TO THIS PROJECT using python in Google Cloud?
I am building a pipeline template in jupyter notebook using
Truncate timestamp to custom unit of time in SQL Snowflake
Function date_trunc in snowflake (docs
snowflake stored procedure is throwing unexpected Token error
I have written down a procedure by following the snowflake documentation to generate a list of 'set' statement and execute them in snowflake. i'm
Python snowflake connection error because of spaces in query
I am trying to run a sql query in my python notebook, code in cell looks like sql = "select date, count(distinct id)
How to you read a csv in SnowPark
I have a bunch of .csv file and i was looking for the easiest way to load them into snowpark? i am not sure which are the apis
GROUP BY day but also show time on day
I have price-table with timestamps and price spanning over 3 years. i would like group these with maximum price per day but also show which time
Ad
Find the stale roles in snowflake
Is there any way to analyze in snowflake, which roles has not been used for any query in snowflake in last one year? the roles view in
SQL Query to get name of all employees under a manager recursively
I am looking for a query to get name of all employees under a particular manager recursively. emp_table
How to resolve nested aggregate function error?
I used case function to bucket aggregate counts of an item and want to divide the sum total of all counts into the value for each bucket (looking
How do I flatten a nested json key/value pair into a single array of values?
In snowflake, i have a data structure like: organization table ------------------ org:variant ------------------ {
Ad
Blog Categories
Ad