Hive3 detailed tutorial (III) data types of hive3

Miss Zhu 2022-02-13 08:38:53 阅读数:453

hive3 hive detailed tutorial iii

Hive Data types and MySQL Data types and Java All data types are similar , But there are differences .
The basic types are shown in the table below :

Hive type Java type
TINYINT byte
SMALLINT short
INT int
BIGINT long
FLOAT float
DOUBLE double
BOOLEAN boolean
string String

Collection data type :
MAP<string,string>
Combination of key value pairs , Can pass KEY visit VALUE, The separator between key values should also be specified when creating the table . Such as :{“opt_obj”:”11111”,”type_name”:”mkt”}

ARRAY< string>

ARRAY Represents a collection of the same data type , Subscripts start from zero , You can use subscripts to access , Such as :[“cn”,”jp”,”us”]

STRUCT < column1:string,column2:string>

Be similar to C Linguistic struct Type can also be used . To visit . Error loading data from file , The data separator in the file should be consistent with that specified in the table creation .

Such as :{“column1”:”a”,”column2”:”b”}

copyright:author[Miss Zhu],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130838512982.html