Skip to content
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

merge #10

Closed
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
282f97d
setup
Sep 24, 2024
a5085f2
datasharing
Sep 24, 2024
8b36a22
taskEmail
Sep 24, 2024
f06f794
Create wf.yml
descampschristopher Sep 24, 2024
2f1df07
Create schemachange.yml
descampschristopher Sep 24, 2024
9a54c43
Update schemachange.yml
descampschristopher Sep 24, 2024
7265a93
Update schemachange.yml
descampschristopher Sep 24, 2024
8a92f31
Update schemachange.yml
descampschristopher Sep 24, 2024
82a53c8
Update schemachange.yml
descampschristopher Sep 24, 2024
5c673ea
Update schemachange.yml
descampschristopher Sep 24, 2024
09ea911
Update schemachange.yml
descampschristopher Sep 24, 2024
a2c892e
migrations
descampschristopher Sep 24, 2024
d9e86ce
Update deploy_parametrized_pipeline.sql
descampschristopher Sep 24, 2024
bdb0ee6
Update deploy_parametrized_pipeline.sql
descampschristopher Sep 24, 2024
7508839
Update schemachange.yml
descampschristopher Sep 24, 2024
ad6acfd
Update schemachange.yml
descampschristopher Sep 24, 2024
f47ad9e
Delete .github/workflows/schemachange.yml
descampschristopher Sep 24, 2024
3c0e070
schemaChange.yml
descampschristopher Sep 24, 2024
bedfa12
Create schemachange.yml
descampschristopher Sep 24, 2024
ef5f2bd
Create schemachange
descampschristopher Sep 24, 2024
9c84cfc
Update schemachange
descampschristopher Sep 24, 2024
181f8db
Update deploy_parametrized_pipeline.sql
descampschristopher Sep 24, 2024
024d2c0
Update deploy_parametrized_pipeline.sql
descampschristopher Sep 24, 2024
fa9eab1
Create schemachanges.yml
descampschristopher Sep 24, 2024
1ae764a
delete
descampschristopher Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions steps/01_setup_snowflake.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ CREATE DATABASE IF NOT EXISTS QUICKSTART_COMMON;
-- API integration is needed for GitHub integration
CREATE OR REPLACE API INTEGRATION git_api_integration
API_PROVIDER = git_https_api
API_ALLOWED_PREFIXES = ('https://github.com/<insert GitHub username>') -- INSERT YOUR GITHUB USERNAME HERE
API_ALLOWED_PREFIXES = ('https://github.com/descampschristopher') -- INSERT YOUR GITHUB USERNAME HERE
ENABLED = TRUE;


-- Git repository object is similar to external stage
CREATE OR REPLACE GIT REPOSITORY quickstart_common.public.quickstart_repo
API_INTEGRATION = git_api_integration
ORIGIN = '<insert URL of forked GitHub repo>'; -- INSERT URL OF FORKED REPO HERE
ORIGIN = 'https://github.com/descampschristopher/sfgithub.git'; -- INSERT URL OF FORKED REPO HERE


CREATE OR REPLACE DATABASE QUICKSTART_PROD;
Expand Down
4 changes: 2 additions & 2 deletions steps/02_access_marketplace_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ USE ROLE ACCOUNTADMIN;
SELECT * FROM oag_flight_emissions_data_sample.public.estimated_emissions_schedules_sample LIMIT 100;
SELECT * FROM oag_flight_status_data_sample.public.flight_status_latest_sample LIMIT 100;
SELECT * FROM global_weather__climate_data_for_bi.standard_tile.forecast_day LIMIT 100;
SELECT * FROM government_essentials.cybersyn.datacommons_timeseries LIMIT 100;
SELECT * FROM us_points_of_interest__addresses.cybersyn.point_of_interest_index LIMIT 100;
SELECT * FROM GLOBAL_GOVERNMENT.cybersyn.datacommons_timeseries LIMIT 100;
SELECT * FROM US_ADDRESSES__POI.cybersyn.point_of_interest_index LIMIT 100;
10 changes: 5 additions & 5 deletions steps/03_harmonize_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ create or replace view weather_forecast as select postal_code, avg(avg_temperatu
-- We use the data provided by Cybersyn to limit our pipeline to
-- US cities with atleast 100k residents to enjoy all the benefits a big city provides during our vacation.
create or replace view major_us_cities as select geo.geo_id, geo.geo_name, max(ts.value) total_population
from government_essentials.cybersyn.datacommons_timeseries ts
join government_essentials.cybersyn.geography_index geo on ts.geo_id = geo.geo_id
join government_essentials.cybersyn.geography_relationships geo_rel on geo_rel.related_geo_id = geo.geo_id
from GLOBAL_GOVERNMENT.cybersyn.datacommons_timeseries ts
join GLOBAL_GOVERNMENT.cybersyn.geography_index geo on ts.geo_id = geo.geo_id
join GLOBAL_GOVERNMENT.cybersyn.geography_relationships geo_rel on geo_rel.related_geo_id = geo.geo_id
where true
and ts.variable_name = 'Total Population, census.gov'
and date >= '2020-01-01'
Expand All @@ -92,8 +92,8 @@ create or replace view major_us_cities as select geo.geo_id, geo.geo_name, max(t

-- Using the geography relationships provided by Cybersyn we collect all the zip codes belonging to a city.
create or replace view zip_codes_in_city as select city.geo_id city_geo_id, city.geo_name city_geo_name, city.related_geo_id zip_geo_id, city.related_geo_name zip_geo_name
from us_points_of_interest__addresses.cybersyn.geography_relationships country
join us_points_of_interest__addresses.cybersyn.geography_relationships city on country.related_geo_id = city.geo_id
from US_ADDRESSES__POI.cybersyn.geography_relationships country
join US_ADDRESSES__POI.cybersyn.geography_relationships city on country.related_geo_id = city.geo_id
where true
and country.geo_id = 'country/USA'
and city.level = 'City'
Expand Down
8 changes: 4 additions & 4 deletions steps/04_orchestrate_jobs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ create or alter table vacation_spots (

-- task to merge pipeline results into target table
create or alter task vacation_spots_update
schedule = '1440 minute'
schedule = '1 minute'
warehouse = 'quickstart_wh'
AS MERGE INTO vacation_spots USING (
select *
Expand Down Expand Up @@ -69,7 +69,7 @@ create or alter task email_notification
if (:options = '[]') then
CALL SYSTEM$SEND_EMAIL(
'email_integration',
'<insert your email here>', -- INSERT YOUR EMAIL HERE
'[email protected]', -- INSERT YOUR EMAIL HERE
'New data successfully processed: No suitable vacation spots found.',
'The query did not return any results. Consider adjusting your filters.');
end if;
Expand All @@ -82,14 +82,14 @@ create or alter task email_notification

CALL SYSTEM$SEND_EMAIL(
'email_integration',
'<insert your email here>', -- INSERT YOUR EMAIL HERE
'[email protected]', -- INSERT YOUR EMAIL HERE
'New data successfully processed: The perfect place for your summer vacation has been found.',
:response);
exception
when EXPRESSION_ERROR then
CALL SYSTEM$SEND_EMAIL(
'email_integration',
'<insert your email here>', -- INSERT YOUR EMAIL HERE
'[email protected]', -- INSERT YOUR EMAIL HERE
'New data successfully processed: Cortex LLM function inaccessible.',
'It appears that the Cortex LLM functions are not available in your region');
end;
Expand Down