This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT GET_DLL( 'SCHEMA','"<Database Name>"."<Schema"Name>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE STAGE <stage name> URL = 's3://<bucket_name>/path/' CREDENTIALS=(AWS_KEY_ID='xxxxxxx'AWS_SECRET_KEY='xxxxxxxxxxxxxx'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LIST @<Stage Name> | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FILE FORMAT <Database>.<Schema>.<File Format Name> | |
TYPE = 'CSV' | |
COMPRESSION = 'AUTO' | |
FIELD_DELIMITER = '|' | |
RECORD_DELIMITER = '\n' | |
SKIP_HEADER = 1 | |
FIELD_OPTIONALLY_ENCLOSED_BY = '\042' | |
TRIM_SPACE = FALSE | |
ERROR_ON_COLUMN_COUNT_MISMATCH = TRUE | |
ESCAPE = 'NONE' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COPY INTO <Table Name> FROM @<Stage Name> | |
FILES = ( '<File Name>' ) | |
FILE_FORMAT = ( FORMAT_NAME = <Format Name> ) | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COPY INTO <Table Name> | |
FROM ( | |
SELECT t.$1 | |
, t.$2 | |
, t.$3 | |
, TO_NUMBER(REPLACE(t.$4,',','.'),8,2) | |
, t.$5 | |
, TO_DATE(t.$6, 'DD-MM-YY') | |
, t.$7 | |
FROM @<Stage Name>/<File Name> t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"username":"<user_name>","key":"<API token>"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"secrets": | |
{ | |
"account" : "<account", | |
"user" : "<user>", | |
"warehouse" : "<warehouse>", | |
"role" : "<role>", | |
"database" : "<database>", | |
"schema" : "<schema>", | |
"password" : "<password>" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting the environment | |
import os | |
from kaggle.api.kaggle_api_extended import KaggleApi | |
# Setting the variabeles | |
os.environ['KAGGLE_USERNAME'] = "<kaggle-username>" | |
os.environ['KAGGLE_KEY'] = "<kaggle-API-token>" | |
# Connecting to Kaggle | |
api = KaggleApi() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting up connection to Kaggle and Snowflake | |
conn_location = '<location Credential file>' | |
connect = json.loads(open(str(conn_location+'/<Credential file>')).read()) | |
#Kaggle variables referencing kaggle in the Credential file | |
os.environ['KAGGLE_USERNAME'] = connect['kaggle']['kaggle-username'] | |
os.environ['KAGGLE_KEY'] = connect['kaggle']['kaggle-API-token'] | |
# Connect to Kaggle |
OlderNewer