建库
create database yuqing_dwd;
建表
drop table yuqing_dwd.t_weibo
create external table yuqing_dwd.t_weibo(
user_id string COMMENT '用户id',
user_name string COMMENT '用户昵称id',
gender string COMMENT '性别用户id',
followers_count string COMMENT '粉丝数量',
weibo_id string COMMENT '微博id',
created_at string COMMENT '微博发布时间',
html string COMMENT '微博内容,html格式',
content string COMMENT '微博内容,文本格式'
)
partitioned by (`date` string)
stored as parquet
location '/yuqing/dwd/weibo'
测试查询数据
select * from yuqing_dwd.t_weibo