欢迎投稿

今日深度:

hive 数据类型,

hive 数据类型,


1: Let`s talk something about the hive data type and file format.

    原始数据类型

   


   STRING is implemented by the Java String, FLOAT is implemented by Java float, etc.
 


2:Collection Data Types




3:create table using the data type :

CREATE TABLE employees (
name STRING,
salary FLOAT,
subordinates ARRAY<STRING>,
deductions MAP<STRING, FLOAT>,
address STRUCT<street:STRING, city:STRING, state:STRING, zip:INT>);


the value in the table :

{
"name": "John Doe",
"salary": 100000.0,
"subordinates": ["Mary Smith", "Todd Jones"],
"deductions": {
"Federal Taxes": .2,
"State Taxes": .05,
"Insurance": .1
  },
"address": {
"street": "1 Michigan Ave.",
"city": "Chicago",
"state": "IL",
"zip": 60600
   }
}


4: to restrict the item records delimited:

CREATE TABLE employees (
name STRING,
salary FLOAT,
subordinates ARRAY<STRING>,
deductions MAP<STRING, FLOAT>,
address STRUCT<street:STRING, city:STRING, state:STRING, zip:INT>
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\001'
COLLECTION ITEMS TERMINATED BY '\002'
MAP KEYS TERMINATED BY '\003'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;





www.htsjk.Com true http://www.htsjk.com/hive/37468.html NewsArticle hive 数据类型, 1: Let`s talk something about the hive data type and file format.     原始数据类型        STRING is implemented by the Java String, FLOAT is implemented by Java float, etc.   2:Collection Data Types 3:cre...
相关文章
    暂无相关文章
评论暂时关闭