Created
April 24, 2023 22:57
-
-
Save rorymalcolm/6aff34623121fbff05bcae2f16762fc4 to your computer and use it in GitHub Desktop.
Create Listening History
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 TABLE | |
listening_history AS | |
SELECT | |
* | |
FROM | |
read_json ( | |
'endsong_*.json', | |
maximum_object_size = 10485760, | |
json_format = 'array_of_records', | |
columns = { | |
ts:'VARCHAR', | |
username:'VARCHAR', | |
platform:'VARCHAR', | |
ms_played:'INTEGER', | |
conn_country:'VARCHAR', | |
ip_addr_decrypted:'VARCHAR', | |
user_agent_decrypted:'VARCHAR', | |
master_metadata_track_name:'VARCHAR', | |
master_metadata_album_artist_name:'VARCHAR', | |
master_metadata_album_album_name:'VARCHAR', | |
spotify_track_uri:'VARCHAR', | |
episode_name:'VARCHAR', | |
episode_show_name:'VARCHAR', | |
spotify_episode_uri:'VARCHAR', | |
reason_start:'VARCHAR', | |
reason_end:'VARCHAR', | |
shuffle:'BOOLEAN', | |
skipped:'BOOLEAN', | |
offline:'BOOLEAN', | |
offline_timestamp:'INTEGER', | |
incognito_mode:'BOOLEAN' | |
}, | |
ignore_errors = true | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment