写的不错,打赏一下

hive的内部表与外部表创建

最近才接触Hive。学到了一些东西,就先记下来,免得以后忘了。

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]

posted @ 2014-04-09 16:32  不负春光,努力生长  阅读(473)  评论(0编辑  收藏  举报