Hive: Data types and File formats

Primative types:

TINYINT    SMALLINT  INT  BIGINT  BOOLEAN  FLOAT  DOUBLE STRING  TIMESTAMP  BINARY

Collection Data Types:

Example:

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

File formats:


 you can overwrite the formats in declare a table:



 Hive is Schema on Read while traditional database Schema on Write.



 

扫描二维码关注公众号,回复: 645290 查看本文章

Reference

<<programming in Pig>>

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types

猜你喜欢

转载自ylzhj02.iteye.com/blog/2036648