Skip to main content

Questions tagged [snowflake-cloud-data-platform]

Snowflake Cloud Data Platform has a multi-cluster, shared architecture that provides a single location for structured and semi-structured data that can be queried using ANSI SQL. Snowflake is a cloud-agnostic platform with very large scale that supports many different workloads: data warehousing and analytics, data lake, data engineering, secure data sharing, data applications, and data science.

snowflake-cloud-data-platform
5 votes
1 answer
4k views

How to split a CSV or JSON file for optimal Snowflake ingestion?

Snowflake recommends splitting large files before ingesting: To optimize the number of parallel operations for a load, we recommend aiming to produce data files roughly 100-250 MB (or larger) in size ...
Felipe Hoffa's user avatar
  • 58.4k
18 votes
7 answers
22k views

generate_series() equivalent in snowflake

I'm trying to find the snowflake equivalent of generate_series() (the PostgreSQL syntax). SELECT generate_series(timestamp '2017-11-01', CURRENT_DATE, '1 day')
Tarik's user avatar
  • 197
5 votes
1 answer
17k views

Dynamic SQL in a Snowflake SQL Stored Procedure

I would like to run a select query in a Snowflake SQL Stored Procedures (not Javascript) using dynamic SQL. Is this possible? What I am looking to do is pass in a database name as a parameter. I ...
Laura Beranek's user avatar
2 votes
4 answers
2k views

Equivalent for Keep in Snowflake

I am trying to convert a oracle code to snowflake, In Oracle: MIN(salary) KEEP (DENSE_RANK FIRST ORDER BY commission_pct) "Worst", What would be corresponding thing as We dont have "...
asd's user avatar
  • 173
0 votes
2 answers
2k views

Snowflake - invoking Python code without creating UDF/Stored Procedure

How to run Python code without defining pernament/temporary User Defined Function or stored procedure? The use case is to run the code one time inside a script and it should avoid creating/dropping ...
Lukasz Szozda's user avatar
18 votes
10 answers
44k views

How to delete duplicate records in Snowflake database table

How can I delete the duplicate records from a Snowflake table? ID Name 1 Apple 1 Apple 2 Apple 3 Orange 3 Orange Result should be: ID Name 1 Apple 2 Apple 3 Orange
Viki's user avatar
  • 191
7 votes
5 answers
9k views

How to pivot on dynamic values in Snowflake

I want to pivot a table based on a field which can contain "dynamic" values (not always known beforehand). I can make it work by hard coding the values (which is undesirable): SELECT * FROM ...
Marco Roy's user avatar
  • 4,638
3 votes
2 answers
1k views

How to do an as-of-join in SQL (Snowflake)?

I am looking to join two time-ordered tables, such that the events in table1 are matched to the "next" event in table2 (within the same user). I am using SQL / Snowflake for this. For ...
MYK's user avatar
  • 2,607
3 votes
1 answer
3k views

Snowflake - View what tables and columns are queried the most

is there any way within snowflake/sql query to view what tables are being queried the most as well as what columns? I want to know what data is of most value to my users and not sure how to do this ...
0004's user avatar
  • 1,218
0 votes
1 answer
479 views

Trying to split one column to multiple columns using Snowflake sql

data need to get split from SOID column to Circ,Language,Words as show above in pic. When trying with below logic :- SELECT SOID, regexp_substr(SALES_ORDER_ITEM_DESCRIPTION, 'Circuit:\\s([a-zA-Z0-9 ]*...
Michael's user avatar
  • 81
9 votes
3 answers
13k views

Get identity of row inserted in Snowflake Datawarehouse

If I have a table with an auto-incrementing ID column, I'd like to be able to insert a row into that table, and get the ID of the row I just created. I know that generally, StackOverflow questions ...
Joshua Schlichting's user avatar
8 votes
2 answers
10k views

Snowflake Creating a List of Dates

This code works perfectly in SSMS, but in Snowflake, not so much. Any suggestions on how I can fix it? set (start_date) = ('2017-07-01'); set (end_date) = ('2022-06-30'); with get_all_dates as ( ...
Chicken Sandwich No Pickles's user avatar
8 votes
2 answers
67k views

Snowflake: "SQL compilation error:... is not a valid group by expression"

Without resorting to CTEs or a sub-query is there any way to use Window functionality with a different summary level than the GROUP BY? COUNT(*) works, but if a column name is specified in the COUNT ...
HarryD's user avatar
  • 103
8 votes
4 answers
2k views

How to access snowflake query profile overview statistics via SQL?

In Snowflake SnowSight UI, in the Query Profile view, there is a section called Profile Overview where you can see the breakdown of the total execution time. It contains statistics like Processing, ...
Gani Simsek's user avatar
8 votes
2 answers
8k views

Snowflake pandas pd_writer writes out tables with NULLs

I have a Pandas dataframe that I'm writing out to Snowflake using SQLAlchemy engine and the to_sql function. It works fine, but I have to use the chunksize option because of some Snowflake limit. This ...
CodingInCircles's user avatar

15 30 50 per page
1
2 3 4 5
36