hive 开发疑问

来源:互联网 发布:卡特背扣绝杀猛龙数据 编辑:程序博客网 时间:2024/06/13 03:48

1.分区表怎么建立?

Create [EXTERNAL] TABLE [IF NOT EXISTS] table_name [(col_name data_type [COMMENT col_comment], ...)] [COMMENT table_comment] [PARTITIONED BY (col_name data_type [COMMENT col_comment], ...)] [CLUSTERED BY (col_name, col_name, ...) [SORTED BY (col_name [ASC|DESC], ...)] INTO num_buckets BUCKETS] [ROW FORMAT row_format] [STORED AS file_format] [LOCATION hdfs_path]


create table partition_test
(member_id string,
name string
)

COMMENT "partition_test
partitioned by (stat_date string)
row format delimited fields terminated by ',';

2.hive 表有主键设定吗?


0 0
原创粉丝点击