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]

原文地址:https://www.cnblogs.com/Wolfmanlq/p/3654504.html