--------------------user_friend-----------------
创建hb_user_friend外部表:
create external table events.hb_user_friend(
row_key string
,user_id string
,friend_id string)
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties('hbase.columns.mapping'=':key,
uf:userid,
uf:friendid')
tblproperties('hbase.table.name'='events_db:user_friend');
创建user_friend内部表:
create table user_friend
stored as ORC AS
select * from hb_user_friend;
------------------------------event_attendee-----------------------------
创建hb_event_attendee外部表:
create external table events.hb_event_attendee(row_key string,event_id string,user_id string,attend_type string)
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties('hbase.columns.mapping'=':key,euat:eventid,euat:userid,euat:state')
tblproperties('hbase.table.name'='events_db:event_attendee');
创建event_attendee内部表:
create table event_attendee
stored as ORC AS
select * from hb_event_attendee;
------------------------------events---------------------------------
创建hb_events外部表:
create external table events.hb_events(
event_id string,
start_time string,
city string,
state string,
zip string,
country string,
lat string,
lng string,
user_id string,
common_words string)
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties('hbase.columns.mapping'=':key,
creator:user_id,
schedule:start_time,
location:city,
location:state,
location:zip,
location:country,
location:lat,
location:lng,
remark:common_words')
tblproperties('hbase.table.name'='events_db:events');
创建events内部表:
create table events
stored as ORC AS
select * from hb_events;
-----------------------------------train---------------------------------
创建hb_train外部表:
create external table events.hb_train(row_key string,
user_id string,
event_id string,
invited string,
timestamp string,
interested string,
not_interested string
)
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties('hbase.columns.mapping'=':key,
eu:user,
eu:event,
eu:invited,
eu:timestamp,
eu:interested,
eu:not_interested
')
tblproperties('hbase.table.name'='events_db:train');
创建train内部表:
create table train
stored as ORC AS
select * from hb_train;
----------------------users------------------------
创建hb_users外部表:
create external table events.hb_users(
user_id string,
birthyear string,
gender string,
locale string,
location string,
timezone string,
joined_at string
)
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties('hbase.columns.mapping'=':key,
profile:locale,
profile:birthyear,
region:gender,
registration:joinedAt,
region:location,
region:timezone
')
tblproperties('hbase.table.name'='events_db:users');
创建users内部表:
create table users
stored as ORC AS
select * from hb_users;