新聞中心
這篇文章將為大家詳細講解有關(guān)Hive數(shù)據(jù)類型有哪些,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
創(chuàng)新互聯(lián)是專業(yè)的承留網(wǎng)站建設公司,承留接單;提供網(wǎng)站設計、做網(wǎng)站,網(wǎng)頁設計,網(wǎng)站設計,建網(wǎng)站,PHP網(wǎng)站建設等專業(yè)做網(wǎng)站服務;采用PHP框架,可快速的進行承留網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!
hive 目前支持的數(shù)據(jù)類型如下:
-- 數(shù)值類型 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
union: UNIONTYPE
例子:
1)Array數(shù)組
數(shù)據(jù)類型相同的元素集合。
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,<'English',90>}
上面的array和map可以組合起來使用,一個人的各科成績:
hive> create table student3
(sid int,
sname string,
grades array
3)struct
結(jié)構(gòu)體:
hive>create table student4
(sid int,
info struct
比如:
{1,{'yy',20,'male'}}
關(guān)于“Hive數(shù)據(jù)類型有哪些”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
當前文章:Hive數(shù)據(jù)類型有哪些
當前URL:http://fisionsoft.com.cn/article/poehpj.html