Created
April 28, 2017 17:05
-
-
Save santagada/9aef0bf08cc9febd4c313158cd62f690 to your computer and use it in GitHub Desktop.
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
/* ardp schema data */ | |
CREATE SCHEMA ardp | |
AUTHORIZATION automated; | |
ALTER USER looker SET search_path TO '$user', looker_scratch, facts, legacy, hub, metadata, accounts, vs, ardp, public; | |
CREATE TABLE ardp.events | |
( | |
event_id INTEGER NOT NULL, | |
advertiser_id INTEGER, | |
campaign_id INTEGER, | |
creative_id INTEGER NOT NULL, | |
publisher_id INTEGER, | |
request_id BIGINT, | |
publisher_domain VARCHAR(500), | |
bundle VARCHAR(500), | |
local_time TIMESTAMP, | |
server_time TIMESTAMP, | |
user_ip VARCHAR(45) NOT NULL, | |
user_country VARCHAR(500), -- based on the IP | |
user_state VARCHAR(500), -- based on the IP | |
user_city VARCHAR(500), -- based on the IP | |
user_zipcode VARCHAR(500), -- based on the IP | |
mobile_device BOOLEAN, -- is it a mobile device or desktop not null | |
user_device_os VARCHAR(500), | |
user_device_os_version VARCHAR(500), | |
user_browser VARCHAR(500), | |
user_browser_version VARCHAR(500) | |
) DISTSTYLE EVEN INTERLEAVED SORTKEY (server_time, local_time, event_id, | |
); | |
REVOKE ALL ON SCHEMA ardp FROM PUBLIC; | |
REVOKE ALL ON ALL TABLES IN SCHEMA ardp FROM PUBLIC; | |
GRANT USAGE ON SCHEMA ardp TO PUBLIC; | |
GRANT SELECT ON ALL TABLES IN SCHEMA ardp TO PUBLIC; | |
GRANT ALL ON SCHEMA ardp TO GROUP super; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment