基本数据类型
Numeric Types
TINYINT
SMALLINT
INT/INTEGER
BIGINT
FLOAT
DOUBLE
DOUBLE PRECISION
DECIMAL
Date/Time Types
TIMESTAMP
DATE
INTERVAL
String Types
STRING
VARCHAR
CHAR
Misc Types
BOOLEAN
BINARY (Note: Only available starting with Hive 0.8.0)
复杂数据类型:
example:
create table student3(
sid int,
info struct<name:string,age:int,sex:string>);
Numeric Types
TINYINT
SMALLINT
INT/INTEGER
BIGINT
FLOAT
DOUBLE
DOUBLE PRECISION
DECIMAL
Date/Time Types
TIMESTAMP
DATE
INTERVAL
String Types
STRING
VARCHAR
CHAR
Misc Types
BOOLEAN
BINARY (Note: Only available starting with Hive 0.8.0)
复杂数据类型:
- Array:数组类型,由一系列相同数据类型的元素组成
example:
create table student(
sid int,
sname string,
grade arrary<float>);
- Map:集合类型,包括key -> Value 键值对,可以通过key来访问元素[key相同的会被覆盖]
example:
create table people_movie(
name string,
movie map<string,string> )
row format delimited fields terminated by "\t"
collection items terminated by ","
map keys terminated by ":";
example:
create table student3(
sid int,
info struct<name:string,age:int,sex:string>);