Skip to content

Instantly share code, notes, and snippets.

@jinwook-k
Created April 3, 2019 14:29
Show Gist options
  • Save jinwook-k/47a6181f26aac73fa72c3cdd6b73eef5 to your computer and use it in GitHub Desktop.
Save jinwook-k/47a6181f26aac73fa72c3cdd6b73eef5 to your computer and use it in GitHub Desktop.
create table account_d
(
account_id bigint encode bytedict,
account_name varchar(100) encode ztsd,
account_update_date date,
primary key (account_id)
)
distsyle all
sortkey(account_id)
;
create table campaign_d
(
account_id bigint encode bytedict,
campaign_id bigint encode bytedict,
campaign_name varchar(150) encode ztsd,
campaign_update_date date,
primary key (account_id, campaign_id)
)
distsyle all
sortkey(account_id, campaign_id)
;
create table campaign_performance_f
(
performance_date date,
account_id bigint encode bytedict,
campaign_id bigint encode bytedict,
impressions int encode bytedict,
clicks int encode bytedict,
cost float encode bytedict,
load_date date,
primary key (performance_date, account_id, campaign_id)
)
distsyle auto
sortkey(performance_date,account_id,campaign_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment