一、建内部表
create table emp (
id string default null comment ‘’
,name string default null comment ‘’
,id_no string default null comment ‘’
)clustered by (id) into 31 buckets
stored as orc
tblpropertirs (“transactional”=“true”);
二、建外部表
create external table emp_ext (
id string default null comment ‘’
,name string default null comment ‘’
,id_no string default null comment ‘’
)
row format serde ‘transwarp.zjrcu.xkl.hive.csvserde’
location ‘/tmp/default/emp_ext’;
三、建分区表
create external table emp_ext (
id string default null comment ‘’
,name string default null comment ‘’
,id_no string default null comment ‘’
,etl_date ‘’
)
partitioned by (etl_date string comment ‘’)
clustered by (id) into 31 buckets
stored as orc
tblpropertirs (“transactional”=“true”);
【TDH】inceptor建内部表、外部表、分区表
最新推荐文章于 2023-12-16 17:25:24 发布
博客主要介绍了Hive中三种表的创建方法,包括内部表、外部表和分区表。详细给出了每种表的创建语句,如内部表使用特定的存储格式和桶设置,外部表指定了序列化方式和存储位置,分区表则增加了分区字段。
1128

被折叠的 条评论
为什么被折叠?



