Remove snowflake bits
This commit is contained in:
parent
a9c9d27c8d
commit
f9e58369ca
1 changed files with 0 additions and 69 deletions
|
|
@ -58,73 +58,4 @@ aws s3 cp s3://dbtlearn/hosts.csv hosts.csv
|
|||
|
||||
How to put the data into the databases is up to you. I've done it successfully using the import functionality of DBeaver.
|
||||
|
||||
# Introduction and Environment Setup
|
||||
|
||||
## Snowflake user creation
|
||||
Copy these SQL statements into a Snowflake Worksheet, select all and execute them (i.e. pressing the play button).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Snowflake data import
|
||||
|
||||
Copy these SQL statements into a Snowflake Worksheet, select all and execute them (i.e. pressing the play button).
|
||||
|
||||
```sql
|
||||
-- Set up the defaults
|
||||
USE WAREHOUSE COMPUTE_WH;
|
||||
USE DATABASE airbnb;
|
||||
USE SCHEMA RAW;
|
||||
|
||||
-- Create our three tables and import the data from S3
|
||||
CREATE OR REPLACE TABLE raw_listings
|
||||
(id integer,
|
||||
listing_url string,
|
||||
name string,
|
||||
room_type string,
|
||||
minimum_nights integer,
|
||||
host_id integer,
|
||||
price string,
|
||||
created_at datetime,
|
||||
updated_at datetime);
|
||||
|
||||
COPY INTO raw_listings (id,
|
||||
listing_url,
|
||||
name,
|
||||
room_type,
|
||||
minimum_nights,
|
||||
host_id,
|
||||
price,
|
||||
created_at,
|
||||
updated_at)
|
||||
from 's3://dbtlearn/listings.csv'
|
||||
FILE_FORMAT = (type = 'CSV' skip_header = 1
|
||||
FIELD_OPTIONALLY_ENCLOSED_BY = '"');
|
||||
|
||||
|
||||
CREATE OR REPLACE TABLE raw_reviews
|
||||
(listing_id integer,
|
||||
date datetime,
|
||||
reviewer_name string,
|
||||
comments string,
|
||||
sentiment string);
|
||||
|
||||
COPY INTO raw_reviews (listing_id, date, reviewer_name, comments, sentiment)
|
||||
from 's3://dbtlearn/reviews.csv'
|
||||
FILE_FORMAT = (type = 'CSV' skip_header = 1
|
||||
FIELD_OPTIONALLY_ENCLOSED_BY = '"');
|
||||
|
||||
|
||||
CREATE OR REPLACE TABLE raw_hosts
|
||||
(id integer,
|
||||
name string,
|
||||
is_superhost string,
|
||||
created_at datetime,
|
||||
updated_at datetime);
|
||||
|
||||
COPY INTO raw_hosts (id, name, is_superhost, created_at, updated_at)
|
||||
from 's3://dbtlearn/hosts.csv'
|
||||
FILE_FORMAT = (type = 'CSV' skip_header = 1
|
||||
FIELD_OPTIONALLY_ENCLOSED_BY = '"');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue