Skip to content

Instantly share code, notes, and snippets.

@randyzwitch
Last active November 7, 2019 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randyzwitch/9c16c09efba63ba225a7b63f731c87e5 to your computer and use it in GitHub Desktop.
Save randyzwitch/9c16c09efba63ba225a7b63f731c87e5 to your computer and use it in GitHub Desktop.
Baywheels extra column schema
--201906 and 201907 files have extra blank column
CREATE TABLE baywheels_tripdata_extracol(
duration_sec INTEGER,
start_time TIMESTAMP,
end_time TIMESTAMP,
start_station_id SMALLINT,
start_station_name TEXT ENCODING DICT,
start_station_latitude FLOAT,
start_station_longitude FLOAT,
end_station_id SMALLINT,
end_station_name TEXT ENCODING DICT,
end_station_latitude FLOAT,
end_station_longitude FLOAT,
bike_id SMALLINT,
user_type TEXT ENCODING DICT,
member_birth_year SMALLINT,
member_gender TEXT ENCODING DICT,
bike_share_for_all_trip TEXT ENCODING DICT,
extracol TEXT ENCODING DICT
);
copy baywheels_tripdata_extracol from 's3://baywheels-data/201906-baywheels-tripdata.csv.zip';
copy baywheels_tripdata_extracol from 's3://baywheels-data/201907-baywheels-tripdata.csv.zip' with (delimiter=';');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment