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
12,258
questions
0
votes
1
answer
37
views
Snowflake SQL. Select column value if 1st 5 characters are numeric and within a Numeric Range
I have a column named ProcedureCode VARCHAR(16777216) in a Table named ProcedureCode.
It has values like '12345,46H', 'A4715,12W', '98765', '99200' etc.
From that Table, I need to pull only rows where ...
1
vote
1
answer
61
views
Create a Sql Statement IN DBT macro and use the query in the dbt model
my_macro.sql
{macro my_macro(value)}
{% set query %}
select A from value
{{ return(query) }}
{% endset %}
{% endmacro %}
model.sql
select * from B
where A in ({{ my_macro(value) }}
when i ...
0
votes
1
answer
18
views
Snowflake - reference variable as part of column name
I am new to Snowflake and trying to use a set variable to call a column name. Here's what I'm currently trying:
set macro = 'Aut_24';
Select *
from my_data1 a
left join mydata2 b on a.id = b.id
where ...
0
votes
0
answers
16
views
Cannot read variant data in Snowflake from an entire file
I have an issue in that I am trying to create an external table on files that contain string data (with no extension). The issue is, the files are in this format
s3://bucket_name/file1/date1/time1/...
-1
votes
1
answer
25
views
how to get history of the snowflake table and how to get what is the version of the snowflake table and operation of the snowflake table as well
select max(timestamp) from (DESCRIBE HISTORY <tablename> ) where operation = 'MERGE'
DESCRIBE HISTORY <tablename> ).orderBy(col("version").desc).first.getLong(0)
I need to ...
0
votes
0
answers
18
views
Limit a user/role to not see the list of other users through snow sight - Users and Role section
Is there a way we can limit a user or a role to not see the list of other users through snow sight - Users and Role section.
Also, is there a way we can limit user to not have Public Role and only ...
0
votes
1
answer
48
views
Snowflake clustering -- should inserts be ordered?
Long story short. When you cluster a snowflake table it physically orders it.
Additional inserts are not 'organized/ clustered' into the table, unless you specify to re-cluster/ auto-recluster.
...
0
votes
2
answers
67
views
Dynamic inputs to Date calendar CTE in Snowflake SQL
In Snowflake, how can I declare variables to make the this CTE calendar table dynamic?
The below works if I hardcode the start_date and day_count params, but I'd like to make it more dynamic.
SET '...
1
vote
0
answers
26
views
Error parsing CSV File when copying Data to Snowflake after July 3rd Incident
I am encountering an error while trying to copy a CSV file into Snowflake from an S3 bucket. This process was functioning correctly until an incident occurred in Snowflake on July 3rd. The error ...
0
votes
1
answer
36
views
How to PIVOT data in snowflake by using ANY without having quotes for 'Column_Names'
How to PIVOT data in snowflake by using ANY without having quotes for 'Column_Names'.
CREATE OR REPLACE TEMPORARY TABLE quarterly_sales(
empid INT,
amount INT,
quarter TEXT)
AS SELECT * FROM ...
0
votes
1
answer
45
views
How to Create a table with spaces in column name
I am creating table in Snowflake.
The column name ‘Full Name’ must have a space in the middle. When I put it in double quotes it automatically put the underscore instead of space.
What is the syntax ...
1
vote
3
answers
43
views
Retain Numeric Precision Using OBJECT_CONSTRUCT
I have a currency value in a table that I want to include in an OBJECT. The problem is that it looks like Snowflake drops the 2 decimal place precision I want to keep when converting to an OBJECT.
...
0
votes
0
answers
25
views
Masking Policies & dynamic tables in snowflake
I'm working with Dynamic Tables in Snowflake and trying to apply masking policies to hide sensitive data. However, when I create the dynamic table, I get the following error:
The masking policies are ...
0
votes
1
answer
61
views
Dynamic SQL and cursor iteration in Snowflake
I've been sitting all weekend, trying to figure out the implementation of cursor iterations in Snowflake procedure blocks.
The goal is to create a dynamic procedure that when called checks all ...
0
votes
1
answer
43
views
Left join later flatten works not like left join, but the same as inner join
With this data:
create or replace table test_json as
select
parse_json('{
"include": [
"x",
"y",
"z"
...