这篇文章将为大家详细讲解有关Hive数据类型有哪些,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
hive 目前支持的数据类型如下:
— 数值类型 Numeric Types
TINYINT (1-byte signed integer, from -128 to 127)
SMALLINT (2-byte signed integer, from -32,768 to 32,767)
INT/INTEGER (4-byte signed integer, from -2,147,483,648 to 2,147,483,647)
BIGINT (8-byte signed integer, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
FLOAT (4-byte single precision floating point number)
DOUBLE (8-byte double precision floating point number)
DOUBLE PRECISION (alias for DOUBLE, only available starting with Hive 2.2.0)
DECIMAL
Introduced in Hive 0.11.0 with a precision of 38 digits
Hive 0.13.0 introduced user-definable precision and scale
NUMERIC (same as DECIMAL, starting with Hive 3.0.0)
–日期/时间类型 Date/Time Types
TIMESTAMP (Note: Only available starting with Hive 0.8.0)
DATE (Note: Only available starting with Hive 0.12.0)
INTERVAL (Note: Only available starting with Hive 1.2.0)
–字符类型 String Types
STRING
VARCHAR (Note: Only available starting with Hive 0.12.0)
CHAR (Note: Only available starting with Hive 0.13.0)
Misc Types
BOOLEAN
BINARY (Note: Only available starting with Hive 0.8.0)
–复杂类型 Complex Types
arrays: ARRAY
maps: MAP
structs: STRUCT
例子:
1)Array数组
数据类型相同的元素集合。
hive>create table student
(sid int,
sname string,
grade array
其中array代表各科成绩,比如:
{1,YY,[80,100,90]}
2)Map
key和value对:
hive>create table student2
(sid int,
sname string,
grade map
其中map指的是学科对应的成绩,比如:
{1,yy,}
上面的array和map可以组合起来使用,一个人的各科成绩:
hive> create table student3
(sid int,
sname string,
grades array
3)struct
结构体:
hive>create table student4
(sid int,
info struct
比如:
{1,{‘yy’,20,’male’}}
这篇文章主要介绍“Intellij Idea常用快捷键有哪些”,在日常操作中,相信很多人在Intellij Idea常用快捷键有哪些问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Intellij Idea常用快捷键有哪些”的疑惑…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。