I hereby claim:
- I am mikeharding on github.
- I am mharding (https://keybase.io/mharding) on keybase.
- I have a public key ASAIoVRwel6MuW7H3jtvUQLEAnvStzXr7jhzKjOVu7FglAo
To claim this, I am signing this object:
# | |
# version 2.1 Derrick Cole, Snowflake Computing | |
# | |
# see co-located Revision-History.txt for additional information | |
# | |
<# | |
.SYNOPSIS |
import configparser | |
from pathlib import Path | |
home = Path.home() | |
config_path = Path.home().joinpath( '.snowsql', 'config' ) | |
def main(): | |
print(f"Use as an import. User's home directory is {home}") | |
def retrieve(key): |
alter session set QUERY_TAG = 'MY_TAG'; | |
select | |
//QTR:Query_123// | |
start_station_id, end_station_id, | |
count(1) num_trips, | |
avg(datediff("minute", starttime, stoptime))::integer avg_duration_mins | |
from trips | |
group by 1, 2 | |
order by 3 desc; |
-- Load NYC Yellow Cab Taxi data into Snowflake | |
-- 09/01/2020 | |
-- https://registry.opendata.aws/nyc-tlc-trip-records-pds/ | |
create database nyc_taxi; | |
create or replace stage taxi_stage url='s3://nyc-tlc/'; | |
list @taxi_stage/ pattern = '.*trip.data/yellow.*'; |
---------------------------------------------------------------- | |
-- Streams - Change Data Capture (CDC) on Snowflake tables | |
-- Tasks - Schedule execution of a statement | |
-- MERGE - I/U/D based on second table or subquery | |
---------------------------------------------------------------- | |
-- reset the example | |
drop table source_table; | |
drop table target_table; | |
drop stream source_table_stream; |
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
source ./control.sh | |
function getMySQLRepo() { | |
cd /tmp | |
wget --quiet —-no-check-certificate https://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm | |
yum -y localinstall mysql-community-release-el6-5.noarch.rpm | |
cd - | |
} |
//**************************************************************************************** | |
// This script builds a master calendar table with both fiscal and calendar based fields | |
//**************************************************************************************** | |
// This is the number of months that the fiscal periods are offset against the calendar | |
// periods. A value of 4 results in a April to March fiscal year. | |
SET vFiscalOffset = 4; | |
// Assign values directly just for SIB | |
//---------------------------------------------------------------------------------------- |
// Sum of last year Sales | |
Sum({$<Year = {$(=Max(Year)-1)}>} Sales) | |
// Sum of Sales for year = 2013 | |
Sum({<Year = {2013}> Sales} | |
QuartersMap: | |
MAPPING LOAD * Inline [ | |
Month, Q | |
1, Q1 | |
2, Q1 | |
3, Q1 | |
4, Q2 | |
5, Q2 | |
6, Q2 | |
7, Q3 |