数据类型
TINYINT 1byte有符号整数 20
SMALLINT 2byte有符号整数 20
INT ** 有符号整数 20
BIGINT** 8byte有符号整数 20
BOOLEAN 布尔类型,true或者false TRUE FALSE
FLOAT 单精度浮点数 3.14159
DOUBLE ** 双精度浮点数 3.14159
STRING ** 字符系列。可以指定字符集。可以使用单引号或者双引号。 ‘now is the time’ “for all good men”
TIMESTAMP **
BINARY
建表
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] row format delimited fields terminated by “分隔符”
[STORED AS file_format]
[LOCATION hdfs_path]